Support » Networking WordPress » Pulling Network Wide Recent Posts – Limit to 5

  • I am pulling recent blog posts network wide using this code:

    $blogs = get_last_updated();
    foreach ($blogs AS $blog) {
    $lastposts = get_posts('numberposts=1');
    foreach($lastposts as $post) :
     <a href="<?php the_permalink(); ?>" style='color:white !important; margin-bottom: 5px;'><?php the_title(); ?></a></li></ul> <br />
     <p><?php printf( _x( 'by %s', 'Post written by...', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ); ?></p>

    I would like to limit it to only pull the 5 most recent posts, but can’t seem to figure it out. I would also like to pull the author’s avatar, size 30×30, but I’m not sure if that it’s possible.

  • The topic ‘Pulling Network Wide Recent Posts – Limit to 5’ is closed to new replies.