Skip to:
Content
Pages
Categories
Search
Top
Bottom

Feature request – two new loop parameters/arguments


  • Andrew
    Participant

    @sm60

    Hi @djpaul @imath @boonebgorges I would just like to suggest a feature request, regarding your trac tickets https://buddypress.trac.wordpress.org/ticket/5644

    There are two extra loop parameters/arguments I would really love to see.

    1. 1. to show a list of activity posts in order of the most favorited. From the most favorited activity posts to least favorited activity posts.
    2. 2. A time range paramater to show a list of activities within a specified time range such as last 12 hours, 24 hours, 1 week etc.

    These two loop arguments can be used together to create a list of trending activity posts.

    For example (I’m not great with code, but you’ll understand what I mean) –

    <?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) . '&max=10&range=24hours&sort=most_favorited'  ) ) : ?>
        <?php while ( bp_activities() ) : bp_the_activity(); ?>
     
            <?php locate_template( array( 'activity/entry.php' ), true, false ); ?>
     
        <?php endwhile; ?>
    <?php endif; ?>

    So the above code will show the top 10 most favorited posts in the last 24 hours 🙂

    Thanks.

  • You must be logged in to reply to this topic.
Skip to toolbar