Question about section in functions.php
-
We’ve integrated BP into an existing theme we had and for some reason there is one section in the original BP functions.php we’ve imported into our existing theme’s functions.php that conflicts with the way our existing theme display our blog… essentially it breaks it. Our blog is in a /blog/ directory, not in the root, but that may not mean anything…. also BP is not in the root either it is at /community/ … if it helps at all, here’s a link http://tinyurl.com/bb726n
If we remove the following from functions.php, what type of destruction and chaos can we expect? I’m not noticing anything out of the ordinary, but that doesn’t make me feel any better about taking this out…
function bp_show_home_blog() {
global $bp, $query_string;
if ( $bp->current_component == HOME_BLOG_SLUG ) {
$pos = strpos( $query_string, 'pagename=' . HOME_BLOG_SLUG );
if ( $pos !== false )
$query_string = preg_replace( '/pagename=' . HOME_BLOG_SLUG . '/', '', $query_string );
query_posts($query_string);
$single_check = strpos( $query_string, '&name=' );
if ( $single_check === false )
bp_core_load_template( 'index', true );
else
bp_core_load_template( 'single', true );
}
}
add_action( 'wp', 'bp_show_home_blog', 2 );
- The topic ‘Question about section in functions.php’ is closed to new replies.