The MU forums have moved to WordPress.org

Modify Recent Post Plugin To Grab Pictures (5 posts)

  1. bobthemonster
    Member
    Posted 16 years ago #

    Hello all! WPMU 2.7 = Rocks my socks...

    I am using the plugin 'List All Recent Posts' - the php code is here: http://pastebin.com/f6b2a0d79

    These recent posts are being displayed on my main page, which grabs from all blogs site wide. How it exists now its all just text - my goal is to bring the post to life with images.

    It would be nice to have this plugin do one of two things:

    1.) Search the post its displaying, and grab the first image in the post, create a thumbnail of it and display it along with the post snippet. If no picture use a default site picture to fill space.

    2.) Don't worry about searching the post, just have an image for every blog that is displayed - ie: if its coming from "bob's blog" have the thumbnail of bob to be used that has been uploaded previously.

    I am not sure if modifying the Recent Posts plugin would be the best method for this, but at this time I am looking for suggestions as to which direction to venture.

  2. bobthemonster
    Member
    Posted 16 years ago #

    I am looking into: http://wpmudevorg.wordpress.com/project/AHP-Sitewide-Recent-Posts-for-WPMU

    The gravatar support may accomplish what I need - I will update.

    Please still post ideas - thanks!

  3. bobthemonster
    Member
    Posted 16 years ago #

    Ok. Turns out I need a combo of both. The AHP Recent Posts code is here: http://pastebin.com/f69aaac10

    The first plugin grabs the most recent posts regardless of who the author is, so it can have the 5 most recent post from 'Bob' - which is the desired effect.

    The second plugin grabs gravatar's that solves my image issue, but it does not grab the most recent posts if the author is repeated, so in reality the most recent posts won't be displayed.

    Any ideas? Thanks!

  4. redsoxmaniac
    Member
    Posted 16 years ago #

    Justin Tadlock has a Get-the-image function on his site that allows you tp place this function in the loop. From an MU perspective, unsure, but his plugin and many other magazine plugins has this image function.

    I've seen it countless times in auto-blog aggregation, but I myself have no experience with this matter.

  5. bobthemonster
    Member
    Posted 16 years ago #

    @redsoxmaniac - thanks for that plugin pointer.

    I figured out what I need to do, just need a little help.

    List all recent posts - http://pastebin.com/f6b2a0d79

    and

    Get the image - http://pastebin.com/f5212defb

    Get the image uses the function call <?php get_the_image(); ?> inside the loop to grab images from posts. So I need to find the spot inside the List all recent plugin to put this function call to grab images with each recent post its grabbing to display.

    Any help as to where to modify the first plugin to achieve this would be appreciated.

    Thanks!

About this Topic

  • Started 16 years ago by bobthemonster
  • Latest reply from bobthemonster