Skip to:
Content

BuddyPress.org

Ticket #2449: activity_front_page.diff

File activity_front_page.diff, 1.0 KB (added by rvenable, 16 years ago)
  • bp-themes/bp-default/functions.php

     
    128128}
    129129add_action( 'pre_get_posts', 'bp_dtheme_fix_get_posts_on_activity_front' );
    130130
     131/* WP 3.0 requires there to be a non-null post in the posts array */
     132function bp_dtheme_fix_the_posts_on_activity_front($posts, $wp_query) {
     133        // NOTE: the double quotes around '"activity"' are thanks to our previous function bp_dtheme_fix_get_posts_on_activity_front()
     134        if ( empty($posts) && !empty($wp_query->query_vars['page_id']) && '"activity"' == $wp_query->query_vars['page_id'] )
     135                $posts = array( (object) array( 'ID' => 'activity' ) );
     136       
     137        return $posts;
     138}
     139add_action( 'the_posts', 'bp_dtheme_fix_the_posts_on_activity_front', 10, 2 );
     140
    131141/****
    132142 * Custom header image support. You can remove this entirely in a child theme by adding this line
    133143 * to your functions.php: define( 'BP_DTHEME_DISABLE_CUSTOM_HEADER', true );