Skip to:
Content
Pages
Categories
Search
Top
Bottom

hide Home Menu on bbPress pages


  • stewmills
    Participant

    @stewmills

    I have:
    WP 4.4.2
    bbPress 2.5.8
    BuddyPress 2.4.3
    Karma theme 3.0.3

    Please see my forum home page here: http://www.cytoviva.com/userforum/

    What I want to do is hide the “white area” with the logo and menu (products, gallery, etc.) ONLY on bbpress forum pages, not the rest of the non-forum pages. Here is the code for my bbPress.php page created from copying another template page and saving it in my child theme (as instructed).

    Can anyone tell me what to edit/remove from this page to just remove the home menu, but LEAVE the main top menu (home, about us, client sites) in blue?

    I have tried several things and can’t seem to get anywhere.

    Thanks in advance!!!

    <?php
    /*
    Template Name: bbPress
    */
    ?>
    <?php get_header(); ?>
    </div><!-- header-area -->
    </div><!-- end rays -->
    </div><!-- end header-holder -->
    </div><!-- end header -->
    
    <?php truethemes_before_main_hook();// action hook, see truethemes_framework/global/hooks.php ?>
    
    <div id="main">
    <?php get_template_part('theme-template-part-tools','childtheme'); ?>
    
    <div class="main-holder">
    <?php
    //retrieve value for sub-nav checkbox
    global $post;
    $post_id = $post->ID;
    $meta_value = get_post_meta($post_id,'truethemes_page_checkbox',true);
    
    if(empty($meta_value)){
    get_template_part('theme-template-part-subnav-horizontal','childtheme');
    }
    ?>
    
    <div id="content" class="content_left_sidebar">
    <?php if(have_posts()) : while(have_posts()) : the_post(); the_content(); truethemes_link_pages(); endwhile; endif;
    comments_template('/page-comments.php', true);
    get_template_part('theme-template-part-inline-editing','childtheme'); ?>
    </div><!-- end content -->
    
    <div id="sidebar" class="left_sidebar">
    <?php dynamic_sidebar('bbpress-custom-sidebar'); ?>
    </div><!-- end sidebar -->
    </div><!-- end main-holder -->
    </div><!-- main-area -->
    
    <?php get_footer(); ?>
Viewing 4 replies - 1 through 4 (of 4 total)

  • Robin W
    Moderator

    @robin-w

    Stewart,

    That’ll be in your header.php, and you’ll need to find the part that says

    <div class="header-area">
    through to
    </div>
    

    and wrap it in

    <?php if (!=bbpress()) : ?>
    <div class="header-area">
    through to
    </div>
    <?php endif; ?>
    
    

    so it will display if it is not a bbpress page


    Robkk
    Moderator

    @robkk

    Here is some CSS that could do the same thing. Add the css styles to your child theme style css or insert the code in a plugin that can hold custom css styles.

    .bbpress .header-holder, 
    .page-template-bbpress .header-holder {
      display: none;
    }

    stewmills
    Participant

    @stewmills

    Tried the CSS route and could not get it to work.

    So, in looking at Robin W suggestion I could not locate the exact section to wrap. I could not locate <div class=”header-area”> with a closing of </div>. Here is what I have (starting with the body section of my page code)

    <body <?php body_class(); ?>>
    <?php if ( 'true' == $boxedlayout ) {echo '<div id="tt-boxed-layout">';}else{echo '<div id="tt-wide-layout">';} ?>
    <div id="wrapper" <?php if (is_page_template('template-homepage-3D.php') || is_page_template('template-homepage-jquery-2.php')) {echo 'class="big-banner"';} ?>>
    <div id="header" <?php if (is_page_template('template-homepage-3D.php')){echo "style='height: 560px;'";} ?>>
    <?php 
    // show the toolbar if selected by the user :
    if ($ka_toolbar == "true"): 
    ?>
    <div class="top-block">
    <div class="top-holder">
    
      <?php truethemes_before_top_toolbar_menu_hook();// action hook, see truethemes_framework/global/hooks.php ?>
      <?php if(has_nav_menu('Top Toolbar Navigation')): ?>
      <div class="toolbar-left">  
      <ul>
      <?php wp_nav_menu(array('theme_location' => 'Top Toolbar Navigation' , 'depth' => 0 , 'container' =>false )); ?>
      </ul>
      </div><!-- end toolbar-left -->
    
      <?php
      //if top toolbar menu not set, we show dynamic sidebar  
      elseif(is_active_sidebar(1)): 
      ?>
      <div class="toolbar-left">  
      <ul><?php dynamic_sidebar("Toolbar - Left Side"); ?></ul>
      </div><!-- end toolbar-left -->
      <?php endif; ?>
      
      <?php if(is_active_sidebar(2)): ?>
      <div class="toolbar-right">
      <?php dynamic_sidebar("Toolbar - Right Side"); ?>
      </div><!-- end toolbar-right -->
      <?php endif; ?>
    
    <?php truethemes_after_top_toolbar_menu_hook();// action hook, see truethemes_framework/global/hooks.php ?>
    </div><!-- end top-holder -->
    </div><!-- end top-block -->
    <?php endif; //end if($toolbar == 'true') ?>
    
    <?php truethemes_before_header_holder_hook();// action hook, see truethemes_framework/global/hooks.php ?>
    <div class="header-holder">
    <div class="rays">
    <div class="header-area<?php if (is_search()) {echo ' search-header';} ?><?php if (is_404()) {echo ' error-header';} ?><?php if (is_page_template('template_sitemap.php')) {echo ' search-header';} ?>">
    
    <?php // Website Logo
    if ($ka_logo_text == ''){
    ?>
    <a href="<?php echo home_url(); ?>" class="logo"><img src="<?php echo $ka_sitelogo; ?>" alt="<?php bloginfo('name'); ?>" /></a>
    <?php }else{?>
    <a href="<?php echo home_url(); ?>" class="custom-logo"><img src="<?php echo get_template_directory_uri(); ?>/images/_global/<?php echo $ka_logo_icon; ?>" alt="<?php bloginfo('name'); ?>" /><span class="logo-text"><?php echo $ka_logo_text; echo '</span></a>';}?>
    
    <?php truethemes_before_primary_navigation_hook();// action hook, see truethemes_framework/global/hooks.php ?>
    <?php if(has_nav_menu('Primary Navigation')): ?>
    <nav>
    <ul id="menu-main-nav">
    <?php wp_nav_menu(array('theme_location' => 'Primary Navigation' , 'depth' => 0 , 'container' =>false , 'walker' => new description_walker() )); ?>
    </ul>
    </nav>
    <?php endif; ?>
    
    <?php truethemes_after_primary_navigation_hook();// action hook, see truethemes_framework/global/hooks.php ?>

    Robin W
    Moderator

    @robin-w

    you need header.php
    not the body part of the code

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar