Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Hooking into get_header to replace header.php in certain files?


Anonymous User 96400
Inactive

@anonymized-96400

have a look here: https://codex.buddypress.org/developer-docs/conditional-template-tags/

there’s some examples as well.

so you could do something like this:

if( bp_is_blog_page() ) {
include( 'blog-header.php' ); // include this file on blog pages
} elseif( bp_is_directory() ) {
include( 'dir-header.php' ); // include that file on directory pages
} else {
get_header(); // otherwise use our normal header
}

Skip to toolbar