Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom Header for Forum


  • ginuwinejewel
    Member

    @ginuwinejewel

    I have two separate headers for my customized skeleton theme, header.php and header-page.php. Is there a way I can call header-page.php on my forums page for bbpress? I tried using:

    if ( is_front_page() ) :

    get_header();

    elseif ( is_bbpress() ) :

    get_header(‘page’);

    else :

    get_header(‘page’);

    in my index.php page, but it didn’t work. Is there another way to do this?

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)

  • Lynq
    Participant

    @lynq

    These will do the majority of your forum, in fact, I think they might do all of them? Check it out and see what you get.

    if (get_post_type() == 'forum')
    if (get_post_type() == 'topic')
    if (get_post_type() == 'reply')

    if((get_post_type() == 'forum') or (get_post_type() == 'topic') or (get_post_type() == 'reply')) {
    get_header(‘page’);
    } else {
    get_header();
    }

    Give it a try.


    Ricky Poon
    Participant

    @poonasor

    is there any way to forums main page? like is_front_page() but for the forums?


    Robin W
    Moderator

    @robin-w

    @poonasor

    function rew_check_forum_root () {
    $forum_slug = '/'.bbp_get_root_slug().'/' ;
    $page_slug = $_SERVER['REQUEST_URI'] ;
    if ($page_slug == $forum_slug) return true ;
    else return false ;
    }
    
    if (rew_check_forum_root() ) echo 'we are at the forum root!'  ;
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar