Hide a Menu Item on Login

Can’t you change CSS rules? .hide-item-not-login{ display: block !important; } .logged-in .hide-item-not-login{ display: none !important; } EDIT To add login/logout menu item, you will need to add one more class to logout menu item. Let’s say you added class .logout-link to logout menu item. Then you can add css like this. .hide-item-not-login{ display: block !important; … Read more

WordPress Menu Exchange On Tablet’s Orientation

cybmeta is right you cannot trust server-side browser detection <div class=”portrait”> wp_nav_menu( array(‘menu’ => ‘primary’ ) ); </div> <div class=”mobile”> wp_nav_menu( array(‘menu’ => ‘mobile’ ) ); </div> <div class=”primary”> wp_nav_menu( array(‘menu’ => ‘primary’ ) ); </div> and use media queries to hide and display menu

Hide menu items if the page content is empty

You could try this, loop through all the wp_nav_menu items, get the post using the Object ID then test to see IF the content is empty. IF that content is empty then unset it from the items array: function remove_empty_items( $items ) { $blog_page = get_option( ‘page_for_posts’ ); $home_page = get_option( ‘page_on_front’ ); $postArr = … Read more

Where is my menu editor

I’ve asked this question a bit to early, but to help others in the feature here’s the solution. For the menu editor to appear, you need to register a menu first: add_action( ‘init’, ‘register_header_menu’ ); function register_header_menu() { register_nav_menu(‘header-menu’,__( ‘Header Menu’ )); } Or as pointed out by Howdy_McGee: add_theme_support( ‘menus’ );

WordPress + Bootstrap [closed]

As far as I’ve seen you’re missing bootstrap CSS grid markup inside your page div, so to start add container class to page div and below that a .row element, for more inforamation on how the Bootstrap grid works check documantation and remember that all Js and styles are based on the correct markup selectors_

How to align last 3 menu items to the right – WordPress main menu [closed]

There’s an easier way with no markup changes and minimal CSS. Live demo/fiddle here, code below: <ul> <li>1a</li><li>2a</li><li>3a</li><li>4a</li><li>5a</li><li>6a</li> </ul> ul { list-style: none; margin: 0; padding: 0; text-align: right; } li { float: left; } li:nth-last-child(1), li:nth-last-child(2), li:nth-last-child(3) { float: none; display: inline-block; }

How to add schema.org SiteNavigationElement and property URL to navbar?

A little searching got me the nav_menu_link_attributes filter: function wpse183311_filter( $atts, $item, $args ) { $atts[‘itemtype’] = ‘http://schema.org/SiteNavigationElement’; return $atts; } add_filter(‘nav_menu_link_attributes’, ‘wpse183311_filter’, 3, 10); Add however many attributes you need to the $atts array as necessary