Site logo

Archived topic

Adjusting archive page options with WPML string translations

1 reply · Started by Naomi on July 27, 2021

Viewing posts 1–2 of 2

Hello,
the code below works with WPML on both category archive pages but stops working when I turn on WPML string translations. Does anyone know why this could be? With a little check I could see that the code does still get past the first "if" but then the options aren't applied. Has anyone else had this? Any suggestions welcome.

add_filter( 'option_generate_blog_settings', 'bw_custom_archive_page_settings' );
function bw_custom_archive_page_settings( $options ) {
	if ( is_category( array( 8, 9 ) ) ) {
		$options['post_image_alignment'] = 'post-image-aligned-left';
		$options['post_image_size'] = 'medium';
		$options['column_layout'] = false;
		$options['featured_column'] = false;
		$options['masonry'] = false;
	}

    return $options;
}

Hi there,

WPML is not my strong suit unfortunately. If the condition is working then i can only assume that String Translation is affecting the strings in that code. Have you asked WPML as they may have had experience with this?

This archived topic is closed to new replies.