Jump to content
Sign in to follow this  
dorin_dumitrascuta

How to make second navigation menu display on all pages?

Recommended Posts

dorin_dumitrascuta

My site is: http://thedollarmill.com I have made a second navigation menu, the one that appears just above the logo (home, site map, feed etc.). What can I do to keep it there when I click a post and get to the post page (it disappears and the main nav is the only menu displaying.) I want it to be on all my pages no matter what. Is there an easy way out, something I missed checking in platform?

Share this post


Link to post
Share on other sites
Kate

Hi Dorin, Unfortunately the only provided functionality is for it to work on post pages. You could create a custom menu and display that...

Share this post


Link to post
Share on other sites
dorin_dumitrascuta

Thanks Kate, how do I do a custom menu? Is it with hooks? Isn't there a code everybody uses for anchoring a custom menu that I can paste and then build the custom menu through WP?

Share this post


Link to post
Share on other sites
MrFent

go to the folder platformbase/sections and create a file called "section.globalnav.php" Paste the following code into that file: <?php /* Section: GlonbalNav Section Author: PageLines Description: Shows a pull quote taken from Version: 1.0.0 Demonstrates how to create a cool site section in 50 lines of code! Note: the only other piece to make this work is the 'pagelines_register_section()' function in your functions.php */ class BaseGlobalNav extends PageLinesSection { function __construct( $registered_settings = array() ) { // BASIC INFO /* The name and ID of the section */ $name = __('GlobalNav Section', 'pagelines'); $id = 'globalnav'; // SETTINGS // Setup description of the section.. $default_settings['description'] = 'Creates a Global nav Section in Base'; // The template areas this section works with.. // Examples areas: 'main', 'content', 'header', 'footer', 'morefoot', sidebar1, array('main', 'content'), etc.... $default_settings['workswith'] = array('header'); // The icon users will see in the admin.. add the full url here $default_settings['icon'] = PL_ADMIN_ICONS . '/map.png'; // OPS /* Draw section using the section API - don't need to touch this*/ $settings = wp_parse_args( $registered_settings, $default_settings ); parent::__construct($name, $id, $settings); } /* Use this function to create the template for the section */ function section_template() { ?>

<?php if(function_exists('wp_nav_menu')){ wp_nav_menu( array('menu_class' => 'main-nav', 'container' => null, 'container_class' => '', 'depth' => 3, 'theme_location'=>'globalnav', 'fallback_cb'=>'nav_fallback') ); } ?>
<?php } function section_persistent (){ register_nav_menus( array( 'globalnav' => __( 'Global Navigation', 'pagelines' ) ) ); } } // Some of the optional functions not used here. function section_options($optionset = null, $location = null) {} /* Adds Options in the admin. Use this function to add them; see PageLines.com for more info */ function section_persistent(){} /* Runs in every page, including in admin (not used in this section) */ function section_head(){} /* Runs in site header, only if section is active (not used here) */ /* End of section class - No closing tag needed */

Share this post


Link to post
Share on other sites
MrFent

Next, go into platformbase/functions.php and add the following code: pagelines_register_section('BaseGlobalNav', 'globalnav', null, array('child' => true) );

Share this post


Link to post
Share on other sites
MrFent

Now you will see a GlobalNav section that you can assign your 2nd menu to.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×