Jump to content
Sign in to follow this  
ankoor

Global Nav section is not being formatted as a menu

Recommended Posts

ankoor

Hi, I made the global nav section as per the video tutorial but the menu is being formatted as a standard list,.could you help me please. So far i have recreated the sections file, registered the function in functions.php and loaded the section it into the header of my site. this is the page: http://foodcycle.org.uk/kitchensink This is the sections.globalnav.php file: ------------------------------------ <?php /* Section: GlobalNav Section Author: PageLines Description: Displays a global site navigation Version: 1.0.0 Taken from the PAgelines support video on making custom sections */ class BaseGlobalNav extends PageLinesSection { function __construct( $registered_settings = array() ) { $name = __('GlobalNav Section', 'pagelines'); $id = 'globalnav'; $settings = array( 'description' => 'Creates a Global Nav Section in PlatformBase', 'workswith' => array('header'), 'icon' => CHILD_IMAGES . '/icon-pullquote.png' ); parent::__construct($name, $id, $settings); } 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' ) ) ); } /* Runs in every page, including in admin (not used in this section) */ } /*End section class - Not closing tag needed */

Share this post


Link to post
Share on other sites
Kate
Try this in your sections.globalnav.php: [code] 'Creates a Global Nav Section in PlatformBase', 'workswith' => array('header'), 'icon' => CHILD_IMAGES . '/icon-pullquote.png' ); parent::__construct($name, $id, $settings); } function section_template() { ?> __( 'Global Navigation', 'pagelines' ) ) ); } /* Runs in every page, including in admin (not used in this section) */ } /*End section class - Not closing tag needed */[/code]

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  

×