Support » Plugin: PB Responsive Images » Featured image

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jacob Dunn


    What code are you using in your theme to display the featured image? If you post that, I can offer some suggestions.

    Hi Jacob and thanks for your quick reply.

    I’m currently using 2012 but I’ve also tried 2011. Here’s a test page: PB works fine for the image in the body but not for the featured image.

    I have added the path for SLIR but I guess that mod_rewrite is working like it should..? At least in the .htaccess I see:
    RewriteRule ^wp-content/plugins/pb-responsive-images/slir/(.*)$ /wp-content/plugins/pb-responsive-images/slir/index.php?r=$1 [QSA,L]

    Plugin Author Jacob Dunn



    While this plugin tries to make things easier, it doesn’t automatically take care of image responsiveness throughout a theme – that’s still in the hands of the theme author. As such, this is still very much a developer oriented plugin, rather than user oriented. When I was asking for the code you’re using, I was referring to the php you’re using to insert the image, not the site or theme name.

    However, as you’re using the 2012 template, I can make some assumptions – you’re likely referring to the ‘the_post_thumbnail’ function call on line 18 of content.php. If so, you’d probably want to replace that code with something like this:

    $image = get_the_post_thumbnail();
    $formats = array(
       array("media"=>"" ,"query"=>"w368","fallback"=>true),
       array("media"=>"(min-device-pixel-ratio:2)" ,"query"=>"w736",),
       array("media"=>"(min-width:420px)" ,"query"=>"w833",),
       array("media"=>"(min-width:420px) and (min-device-pixel-ratio:2)" ,"query"=>"w1000",),
    echo RIP::get_picture($image,$formats);

    The sizes above are probably incorrect, I just pasted the code from the help tab on the plugin page. You’ll have to figure out what sizes you’d like to use in relation to that image in your theme, and do the same for any other images inserted outside of anything not filtered via ‘the_content’. It’s not an easy solution, but it’s the cleanest comprehensive solution I have come up with for this very sticky problem.

    Hope that helps!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Featured image’ is closed to new replies.