Conditional thumbnails size for related posts
-
Hi everyone !
I’m trying to obtain two different thumbnails size for my related posts.
I have two main different categories type for my posts, ”Musical news” and “Podcasts”. The first one categories post thumbnails match with the Jetpack related posts image size (around 16:9). However, I’d like to have a different one size setting for the Podcasts category (a square style).
Here is the my current code :
// Make Jetpack related posts thumbnails size conditional function jetpackchange_image_size ( $thumbnail_size ) { $thumbnail_size['width'] = 350; $thumbnail_size['height'] = 350; return $thumbnail_size; } if ( in_category( array( 363, 365 ) ) ) { add_filter( 'jetpack_relatedposts_filter_thumbnail_size', 'jetpackchange_image_size' ); }
363 & 365 are my Podcasts categories ID for English and French.
The conditional tag has no effect on the filter. I tried different ones but without results.Anyone have an idea how to figure out that?
Cheers
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Conditional thumbnails size for related posts’ is closed to new replies.