Documentation

Everything you need to get started with Blocksy Theme and Companion

Add Gender-specific Translations

Some languages might have different prepositions or words that depend on the gender of the main noun. For example, the next/previous labels from the post navigation. These can be different depending on the post name.

We can only achieve this with a little bit of code, as WordPress still does not support this feature – https://core.trac.wordpress.org/ticket/42725.

Next/Previous labels for Post Navigation

add_filter(
	'blocksy:post-navigation:previous-post:label',
	function ($default) {
		
		if (get_post_type() === 'post') {
			return __( 'Abracadabra %s', 'blocksy' );
		}
		
		return $default;
	}
);

add_filter(
	'blocksy:post-navigation:next-post:label',
	function ($default) {
		
		if (get_post_type() === 'post') {
			return __( 'Abracadabra %s', 'blocksy' );
		}
		
		return $default;
	}
);

In this example, we grab the necessary post type, then modify the translation of the next/previous label on the fly.

Not the solution you are looking for?

Please check other articles or open a support ticket.