• I have separate images for every post.Is there any way to show those already created images instead of plugin to create and show thumbnails from the first image of the post.

    Like for every post i have image v(post-id).jpg [ eg- v256.jpg ] in a separate image directory. I tried modifying the following code but wasn’t able to make it.
    Code:

    // get thumbnail
          if ($instance['thumbnail']['active'] && $this->thumb ) {
    // let's try to retrieve the first image of the current post
          $img = $this->get_img($wppost->ID);
          if ( (!$img || empty($img)) ) {
    		$thumb = "";
           } else {
    		$thumb = "<a href=\"".get_permalink($wppost->ID)."\" title=\"". htmlspecialchars($title_attr) ."\"><img src=\"". $this->pluginDir . "/scripts/timthumb.php?src=". $img[1] ."&h=".$instance['thumbnail']['height']."&w=".$instance['thumbnail']['width']."&zc=1\" alt=\"".$wppost->post_title."\" border=\"0\" class=\"wpp-thumbnail\" width=\"".$instance['thumbnail']['width']."\" height=\"".$instance['thumbnail']['height']."\""."/></a>";
    	}
    }

    I want to include my v(post-id) images instead of thumbnails by plugin.If anyone could help it would be greatly appreciated.

    Thanks

    Akshay

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Akshay,

    Please replace that code with:

    // get thumbnail
    if ($instance['thumbnail']['active']) {
    	$thumb = "<a href=\"".get_permalink($wppost->ID)."\" title=\"". htmlspecialchars($title_attr) ."\"><img src=\"path/to/your/image/here/v".$wppost->ID.".jpg\" alt=\"".$wppost->post_title."\" border=\"0\" class=\"wpp-thumbnail\" width=\"".$instance['thumbnail']['width']."\" height=\"".$instance['thumbnail']['height']."\""."/></a>";
    }

    … where path/to/your/image/here/ is the path where your custom thumbnails are.

    Give it a try and let me know the results.

    Thread Starter akshay1409

    (@akshay1409)

    Thank you, Ikki24!!
    Its working…

    May I know where the code should be add ?

    Because I have similar problem here, I wanna call Post Image Attachment rather that grab fisrt image in a post.

    Any Idea.?

    Hi mansur,

    You can find it inside wordpress-popular-posts.php. About the Post Thumbnail feature, someone else suggested it not long ago and it’s been integrated into the beta version of the next release of my plugin. It should be out within the next few days so you might want to wait instead.

    Cool, Thank you for quick reply.
    At least I know that’s possible to implement.

    sure I will wait. ??

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: WordPress Popular Posts] Override with Custom Thumbnails’ is closed to new replies.