bluemoonsound on "[Plugin: Jetpack by WordPress.com] 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

https://wordpress.org/plugins/jetpack/

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 339 تاريخ : سه شنبه 19 مرداد 1395 ساعت: 18:54