Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Comments won't display on main blog


r-a-y
Keymaster

@r-a-y

I think I’ve got it.

Do you have the same functions.php in your “buddypress-home” theme?

This is the code that does the magic:

function bp_show_home_blog() {
global $bp, $query_string;

if ( $bp->current_component == BP_HOME_BLOG_SLUG ) {
$pos = strpos( $query_string, 'pagename=' . BP_HOME_BLOG_SLUG );

if ( $pos !== false )
$query_string = preg_replace( '/pagename=' . BP_HOME_BLOG_SLUG . '/', '', $query_string );

query_posts($query_string);

if ( is_single() )
bp_core_load_template( 'single', true );
else if ( is_category() || is_search() || is_day() || is_month() || is_year() )
bp_core_load_template( 'archive', true );
else
bp_core_load_template( 'index', true );
}
}
add_action( 'wp', 'bp_show_home_blog', 2 );

Skip to toolbar