Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: renaming index.php messes up lay-out?


ardentfrost
Member

@ardentfrost

It sounds like what you need is to overload the bb_get_location function. This is easy to do in bbpress. You need to make a set of functions like this:

is_home() {

if( 'home-page' == get_bb_location() )

return true;

else

return false;

}

get_home_location() {

if ( bb_find_filename($_SERVER['PHP_SELF']) == 'home.php' )

return 'home-page';

}

apply_filter( 'get_bb_location', 'get_home_location' );

That’s untested, but I think that should work. Basically what you want to do is add in your locational test when bb_location is called. Then you can just call is_home() and it’ll do what you want. Of course, if you don’t want any other part of the forum to care if it’s on the home or not, you can take out all that stuff at the end that integrates it with get_bb_location, and just do this:

is_home() {

if( 'home-page' == get_home_location() )

return true;

else

return false;

}

get_home_location() {

if ( bb_find_filename($_SERVER['PHP_SELF']) == 'home.php' )

return 'home-page';

}

Whichever you want to do. The second is easier, the first is more versatile.

Skip to toolbar