Ready to get started?Download WordPress


Yet Another Related Posts Plugin (YARPP)
[resolved] [Plugin: Yet Another Related Posts Plugin] Thumbnails of Related Posts (2 posts)

  1. Ben
    Posted 2 years ago #


    I have been attempting to link the post thumbnails with the related posts. I prefer to manipulate the background images with CSS, so I applied a code that strips the html tags from the php code. For that purpose I applied the following:

    	$image_id = get_post_thumbnail_id();
       	$image_url = wp_get_attachment_image_src($image_id,'cia_post_thumb_ra_big');
    	$image_url = $image_url[0];

    Unfortunately when I apply this as a background-image in my CSS it retrieves the thumbnail source of the post the visitor is reading rather than the thumbnail sources of the related posts. The product of my attempts can be seen here.

    Any help would be appreciated.


  2. Ben
    Posted 2 years ago #


    The code I pasted above does indeed work, I just forgot to put it inside of the while loop. Once I did that, everything worked perfectly.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic