• So I’ve been tinkering about trying to get this to work in my templates to display the Featured Image using your plugin. My code at the moment looks like this:

    <?php if ( has_post_thumbnail() ) : // check if the post has a Post Thumbnail assigned to it.?>
    	<a>" title="<?php the_title_attribute( "echo=1" ); ?>" rel="bookmark" class="featured-image-link">
    	<?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); ?>
    	<?php if (is_plugin_active( 'pb-responsive-images' )){
    
    		RIP::reset_options();
    		RIP::get_picture(the_post_thumbnail());
    
    	} else {
    		the_post_thumbnail();
    
    	}?>
    	</a>
    <?php endif; ?>

    It will generate an image, but it’s just the default image the same as what the_post_thumbnail() generates with none of the coolness your plugin adds.

    How would I get this to work?

    Thanks!

    http://wordpress.org/plugins/pb-responsive-images/

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

    (@spacemanspud)

    This code seems almost there, just a few things:

    • RIP::get_picture only returns a string, it doesn’t output it
    • the_post_thumbnail outputs a string, but doesn’t return it

    Those two things in combination are why it always just shows the result from the_post_thumbnail. Try paring your code down to:

    <?php if ( has_post_thumbnail() ) : // check if the post has a Post Thumbnail assigned to it.?>
    	<a title="<?php the_title_attribute( "echo=1" ); ?>" rel="bookmark" class="featured-image-link">
    	<?php if (class_exists( 'RIP' )){
    		echo RIP::get_picture(get_the_post_thumbnail());
    	} else {
    		the_post_thumbnail();
    	}?>
    	</a>
    <?php endif; ?>

    Hope that helps!

    Thread Starter marblegravy

    (@marblegravy)

    Yep, that helps a lot! Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Resizing the Featured Image?’ is closed to new replies.