Forums

[Plugin: WP Post Thumbnail] Can anyone get the $Wppt->get_post_thumbnail() to work? (4 posts)

  1. xl_brain
    Member
    Posted 2 months ago #

    I have tried everything to get this to work. Has anyone been able to get it working? I'm simply pasting the sample code into the loop of the default WP theme, and then replaced the preset name with the one I am using. Any help would be really really appreciated!

    http://wordpress.org/extend/plugins/wp-post-thumbnail/

  2. johnbenedict
    Member
    Posted 2 months ago #

    I'm having an issue with this too.

    if ( function_exists( '$Wppt->get_post_thumbnail' ) ) {

    Messes things up. Or makes nothing display anyway.

    If you take the rest of the code out of that - it works. But then you're not checking for that function.

  3. johnbenedict
    Member
    Posted 2 months ago #

    I have a 'work-around'.

    <?php //if ( function_exists( '$Wppt->get_post_thumbnail' ) ) {
    	$thumb = $Wppt->get_post_thumbnail( $post->ID, 'thumbnail_name' );
    	if ( !empty( $thumb ) ) { ?>
    		<a href="<?php echo get_permalink($post->ID); ?>" title="<?php echo $post->post_title; ?>"><img class="thumbnail" src="<?php echo $thumb['url']; ?>" title="<?php echo $thumb['title']; ?>" alt="<?php echo $thumb['alt']; ?>" width="<?php echo $thumb['width']; ?>" height="<?php echo $thumb['height']; ?>" /></a>
    	<?php } else { ?>
    		<a href="<?php echo get_permalink($post->ID); ?>" title="<?php echo $post->post_title; ?>"><img class="thumbnail" src="/imgs/generic_thumb.jpg" alt="image" width="220" height="120" /></a>
    <?php } ?>

    Nothing fancy. It just checks to see if there is a thumbnail for each post. If there isn't it uses a generic thumbnail image - so be sure to make and post and link correctly to a generic thumbnail.

  4. er16004
    Member
    Posted 1 month ago #

    Thanks, johnbenedict! You workaround worked perfectly!!

Reply

You must log in to post.

About this Topic