Nomi,
You can use a filter to set image size for particular pages via is_single
or is_page( 123 )
type checks.
See https://aihrus.zendesk.com/entries/23677122-How-do-I-change-the-image-size-.
Thread Starter
nomi
(@nomi)
Thanks, Michael!
I tried using is_page() as referenced here:
WordPress forum post
It’s not working for me though. If I remove the conditional, it works, but not with it.
Here’s what I have:
if ( is_page() ) {
add_filter( 'testimonials_widget_image_size', 'my_testimonials_widget_image_size' );
function my_testimonials_widget_image_size( $size ) {
$size = array( 575, 350 );
return $size;
}
}
Did you read how to use is_page
at http://codex.wordpress.org/Function_Reference/is_page?
You’re missing a page number or slug name.
Thread Starter
nomi
(@nomi)
I thought that if you use it without the page number or slug than it means it applies to any page?
It’s still not working with the number or the slug though. Here’s the code I have now:
if ( is_page('reviews') ) {
add_filter( 'testimonials_widget_image_size', 'my_testimonials_widget_image_size' );
function my_testimonials_widget_image_size( $size ) {
$size = array( 575, 350 );
return $size;
}
}
Are you sure you’re on a page? Is the page actually an archive? If so, look at the bottom of the is_page
URL for alternate conditionals to work with.
Thread Starter
nomi
(@nomi)
Hmmm, yep, it’s definitely a page. Weird, right? I think I’m going to just resize the widget images via css instead.
Sorry for being a pain. Thanks for the help!
Thread Starter
nomi
(@nomi)
Did you try the page id instead of reviews? It seems you’ve got a non-root site happening and I don’t know how WordPress works with that.