WordPress.org

Forums

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

  1. zzelladonatella
    Member
    Posted 3 years 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

  • Advanced Most Recent Posts Mod
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.