[BuddyPress Business Theme] Menus enabled?

Has anyone been able to enable Menus for this theme? I'm having an issue where the content or links that I want to present in my navigation bar are not showing up. This is partially due to Menus not being enabled for this theme (that I've been able to find). I'd love to be able to enable Menus on this theme. Any assistance would be greatly appreciated. :slight_smile:

  • Tammie
    • WordPress Wizard

    Hi there and welcome to WPMU DEV. Business doesn't support wordpress menus out of the box - not all our themes do currently if they were before 3.0 themes (business is one of those). To get those you would be looking at customisation of the template.

    First up I don't know if you are aware of child and parent themes but I'd recommend you use them on any theme changes.

    You do not say if you are using BuddyPress or not so lets go over a more general approach.

    The file you want to be working with it: includes/main-navigation.php. Before that though in functions.php we're going to add this:

    register_nav_menus( array(
    	'primary' => __( 'Primary Navigation', 'bp_business'),
    ) );

    Then in main-navigation.php we're going to want to look at calling the menu. It's going to require some work arounds in the theme perhaps with another level or so of navigation - that's something you will see once you do it. However, the basics are:

    <?php wp_nav_menu( array('menu' => 'mymenu', 'menu_class' => 'sf-menu', 'container' => '', )); ?>

    You'd place this where you want the menu to appear for instance you can remove from line 5 until line 76 if you want. It would remove all and you'd have to put the BuddyPress navigation at the bottom though.

    The key is make sure you get a opening and closing ul and do not add that menu IN an existing ul - you may have to add in a new div also if keep the existing ul list:
    <ul></ul>

    All this said in a coming update we are going to try and get all our themes up to having these dynamic menus. You could perhaps add to the existing navigation hard coding until then if this is all a bit too daunting for now.

  • Calleah
    • WPMU DEV Initiate

    Now it's not working and I have no idea what has changed.

    <?php include( TEMPLATEPATH . '/includes/conditional-functions.php' ); ?>
    	<div class="navigation-wrapper">
    		<div class="top-navigation">
    			<div class="navigation-block">
    <ul>
    		<?php wp_nav_menu( array('menu' => 'mymenu', 'menu_class' => 'sf-menu', 'container' => '', )); ?>
    </ul>
    					<div class="clear"></div>
    			</div>
    		</div>
    	</div>
  • Tammie
    • WordPress Wizard

    I am happy to help you sort it. However, how are you removing the child theme? Ideally we'd suggest you don't remove that and just write over the parent. What occured that meant that happened? If you want you can even upload your changed files via the form here (I think it takes zips).

  • Promoshake
    • Site Builder, Child of Zeus

    It doesn't work for me neither. I followed your instructions i modified bp_functions.php

    // Blog Buttons
    if ( bp_is_active( 'blogs' ) )
    	add_action( 'bp_directory_blogs_actions',  'bp_blogs_visit_blog_button' );
    
    register_nav_menus( array(
    	'primary' => __( 'Primary Navigation', 'bp_business'),
    ) );
    ?>

    Then i modified the main-navigation.php

    <?php include( TEMPLATEPATH . '/includes/conditional-functions.php' ); ?>
    
    	<div class="navigation-wrapper">
    
    		<div class="top-navigation">
    
    			<div class="navigation-block">
    <ul><?php wp_nav_menu( array('menu' => 'mymenu', 'menu_class' => 'sf-menu', 'container' => '', )); ?></ul>
    <ul class="sf-menu sf-js-enabled sf-shadow">
    <li class="selected">
    <a href="http://center.onvasemarier.fr" title="Home">Home</a>
    </li>
    <li class="page_item page-item-157">
    <a href="http://center.onvasemarier.fr/chi-siamo/" title="Chi Siamo">Test</a>
    </li>
    <li class="page_item page-item-161">
    <a href="http://center.onvasemarier.fr/corydoras/" title="Corydoras">Corydoras</a>
    </li>
    <li class="page_item page-item-159">
    <a href="http://center.onvasemarier.fr/discus/" title="Discus">Discus</a>
    </li>
    <li class="page_item page-item-63">
    <a href="http://center.onvasemarier.fr/store/" title="Disponibilta" class="sf-with-ul">
    <ul style="float: none; width: 13.666666666666666em; display: none; visibility: hidden; ">
    </li>
    <li class="page_item page-item-163">
    <a href="http://center.onvasemarier.fr/loricardi/" title="Loricardi">Loricardi</a>
    </li>
    <li class="page_item page-item-179">
    <a href="http://center.onvasemarier.fr/mangimi/" title="Mangimi">Mangimi</a>
    </li>
    <li class="page_item page-item-167">
    <a href="http://center.onvasemarier.fr/premi/" title="Premi">Premi</a>
    </li>
    <li class="page_item page-item-165">
    </ul>
    
    <?php endif; ?>

    but i still can't see any change. Where should i upload the bp-functions.phph and the main-navigation.php files ? In the child theme folder ?

  • Promoshake
    • Site Builder, Child of Zeus

    oh srry i put the first code in the wrong file bp-functions instaed of functions.php . So i edited the right file
    fonction.php

    <?php
    register_nav_menus( array(
    	'primary' => __( 'Primary Navigation', 'bp_business'),
    ) );
    
    define('TEMPLATE_DOMAIN', 'bp-business');

    But when i uplaod this to /public_html/wp-content/themes/bp-business-child

    i get an error message from my browser

    where should i uplaod the edited file ?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.