Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // header.php
- <div id="menu" class="col-lg-8 col-md-8">
- <?php
- if (function_exists('wp_nav_menu')) {
- wp_nav_menu(array(
- 'theme_location' => 'wpj-main-menu',
- 'menu_id' => 'dropmenu',
- 'menu_class' => 'slimmenu',
- 'fallback_cb' => 'wpj_default_menu'));
- }
- else {
- wpj_default_menu();
- }
- ?>
- </div> <!-- end div #menu -->
- // function.php
- // add menu support and fallback menu if menu doesn't exist
- add_action('init', 'wpj_register_menu');
- function wpj_register_menu() {
- if (function_exists('register_nav_menu')) {
- register_nav_menu( 'wpj-main-menu', __( 'Main Menu', 'brightpage' ) );
- }
- }
- function wpj_default_menu() {
- echo '<ul id="dropmenu" class="slimmenu">';
- if ('page' != get_option('show_on_front')) {
- echo '<li><a href="'. home_url() . '/">Home</a></li>';
- }
- wp_list_pages('title_li=');
- echo '</ul>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement