How to add menù section to my WordPress template?

You need to edit functions.php andding the following line <?php register_nav_menu( ‘primary’, ‘Primary Menu’ ); ?> Then go in admin section Apearence-Menus and create one menu In the header replace <?php wp_list_pages(‘title_li=&depth=1’); ?> for example (the primary menu) with: <?php wp_nav_menu( array( ‘theme_location’ => ‘primary’)); ?> more details for nav_menu here

Sticky menu for WP custom menubars

What you could do is the following: 1) Make a javascript-file and put the following content into it: $(function(){ var stickyHeaderTop = $(‘#stickyheader’).offset().top; $(window).scroll(function(){ if( $(window).scrollTop() > stickyHeaderTop ) { $(‘#stickyheader’).css({position: ‘fixed’, top: ‘0px’}); } else { $(‘#stickyheader’).css({position: ‘static’, top: ‘0px’}); } }); }); 2) Save this file in your theme folder as (for example) … Read more

Why Isn’t My WP_Nav_Menu returning false?

it doesn’t return false because the menu exists in every case, you’re just unsetting all of the menu items. you’re not setting an items_wrap arg, so that defaults to the ul wrapper. maybe try removing it by setting it explicitly to just the child items: ‘items_wrap’ => ‘%3$s’ note, you’ll then have to manually wrap … Read more

Rename menu items for All except super admin

/** * Changes Label of Admin Menu items * @global array $menu * @global array $submenu */ function change_post_menu_label() { global $menu; global $submenu; $menu[2][0] = ‘Home’; $menu[5][0] = ‘Articles’; $submenu[‘edit.php’][5][0] = “All Articles”; // var_dump($submenu); // var_dump($menu); echo ”; } if(!is_super_admin()){ add_action( ‘admin_menu’, ‘change_post_menu_label’ ); } You can print the array echo “<pre>”; print_r($menu); … Read more

Hide a menu on posts

if (is_single()) { // DONT SHOW MENUS } you may pass a post id for any specific post for eg – if (is_single(‘4’)) { // DONT SHOW MENUS } will execute on post with id = 4 . hope it helps