• I’m using the testimonials widget in the sidebar and also on a page using the shortcode: [testimonialswidget_list]

    Is there a way to make the images in the widget and the ones on the page have two different sizes? Everything I’ve found changes them globally.

    Or, ideally, it would be great to have the full-size images on the page with the shortcode.

    Thanks!

    http://ww.wp.xz.cn/extend/plugins/testimonials-widget/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Michael Cannon

    (@comprock)

    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 Naomi Niles

    (@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;
    }
    }

    Plugin Contributor Michael Cannon

    (@comprock)

    Did you read how to use is_page at http://codex.ww.wp.xz.cn/Function_Reference/is_page?

    You’re missing a page number or slug name.

    Thread Starter Naomi Niles

    (@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;
    }
    }
    Plugin Contributor Michael Cannon

    (@comprock)

    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 Naomi Niles

    (@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!

    Plugin Contributor Michael Cannon

    (@comprock)

    Got url?

    Thread Starter Naomi Niles

    (@nomi)

    Plugin Contributor Michael Cannon

    (@comprock)

    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.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Two different image sizes?’ is closed to new replies.