Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I set “Show NewBlogPosts” as default on acitivity-stream?


  • nickrita
    Participant

    @nickrita

    I postet this question again 6 years ago and got an answer that worked until now:
    https://buddypress.org/support/topic/how-can-i-set-show-newblogposts-as-default-on-acitivity-stream/

    functions.php:

    function blog_posts_by_default( $query_string ) {
    global $bp;
    if ( !$query_string )
    $query_string = '';
    if ( ($bp->current_component == BP_ACTIVITY_SLUG || !$bp->current_component) ) {
    if ( strpos( $query_string, 'action' ) == 0 )
    $query_string .= '&type=new_blog_post&action=new_blog_post';
    }
    return $query_string;
    }
    add_filter( 'bp_dtheme_ajax_querystring', 'blog_posts_by_default' );
    

    Now I’m on wp 4.7.1, bp 2.7.4, php 7.0
    It doesn’t work anymore. There ist everything of Blogs in the activity stream, not only posts.

    I changed the activity loop in this, but this allone doesn’t work.

    In child buddypress/activity/index.php

    <li id="activity-filter-select" class="last">
    				<label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label>
    				<select id="activity-filter-by">
    					 <option value="new_blog_post" selected><?php _e( 'Posts', 'buddypress' ); ?></option>
    
    					<?php bp_activity_show_filters( 'blogs' ); ?>
    

    Can anybody please post the complete code I need, not just a link to activity loop, because I read any link and still don’t know what I can do now.

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar