Skip to:

Creating a new front page widget to display sitewide posts

  • Anonymous

    Hi all,

    I am creating a widget to display sitewide posts with a few changes to the default one that comes with BuddyPress.

    Is there any changes to the_loop that I should take into consideration?

    I want to use the loop code provided by Justin Tadlock as a base.

    I have made a few changes, have the title, avatar & post excerpt working but I can’t get the_ID(), edit_post_link(), comments_popup_link, the_tags() & the_category() working correctly.

    I am using

    <?php $posts = bp_blogs_get_latest_posts( null, $instance['max_posts'] );
    if ( $posts ) : foreach ( $posts as $post ) : ?>
    <a href="<?php echo bp_post_get_permalink( $post, $post->blog_id ) ?>"
    title="<?php echo apply_filters( 'the_title', $post->post_title ) ?>">
    <?php echo apply_filters( 'the_title', $post->post_title ) ?></a>
    <?php endforeach; endif; ?>

    which does get the correct title & link perfectly, but any tips on getting the categories & tags, as well as the correct edit_post_link assigned to the posts in the results?

  • The topic ‘Creating a new front page widget to display sitewide posts’ is closed to new replies.
Skip to toolbar