Skip to:
Content
Pages
Categories
Search
Top
Bottom

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


Boone Gorges
Keymaster

@boonebgorges

I don’t know how to fix this in a theme or through a plugin function. The reason is that the activity page is the default, which is shown when no $object is passed to bp_dtheme_ajax_querystring. bp_dtheme_ajax_querystring returns false when there’s no object, so there’s no content to filter.

Here’s a way to more or less fix the problem:

1) Put this in functions.php of your theme:

function members_alpha_by_default( $query_string ) {
global $bp;
if ( $bp->current_component == BP_ACTIVITY_SLUG || !$bp->current_component)
$query_string = 'type=new_blog_post&action=new_blog_post';

return $query_string;
}
add_filter( 'bp_dtheme_ajax_querystring', 'members_alpha_by_default' );

2) In bp-themes/default/_inc/ajax.php, comment out lines 23 and 24, which read

if ( empty( $object ) )
return false;

You’ll lose this hack, of course, when you upgrade BP.

Skip to toolbar