WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Most Recent Posts Mod
Just what I needed (1 post)

5 stars
  1. zzelladonatella
    Member
    Posted 1 year ago #

    Great plugin, just what I needed.
    I added some code to use the featured image (if there is one) before reverting to the default:
    Before this line:
    if (!$img && $defimage)
    Place the following code:

    if(!$img){
      $featured_img = get_post_thumbnail_id($post->ID);
      $imgsrc = wp_get_attachment_image_src($featured_img, 'thumbnail');
      if(!empty($imgsrc[0])) { $img = $imgsrc[0]; }
    }

    Untick "get first image" and "get first attached image" and the post's featured image will be used as the thumbnail.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.