How To Conditionally Change Menu In Same Theme Location

Yes, You can easily switch menus using conditional tags. For example If you want to show different menu for logged in user and non-logged in user then It may be like: <?php if ( is_user_logged_in() ) { wp_nav_menu( array( ‘theme_location’ => ‘logged-in-menu’ ) ); } else { wp_nav_menu( array( ‘theme_location’ => ‘logged-out-menu’ ) ); } … Read more

Add monthly archives menu and submenu

And this is the custom code I put in my “functions.php” of my child theme. It is important to notice that there are many things to get improved (like creating an id for every submenu and grab the classes dinamically in case you change the theme) but this was a “quick and dirty” solution. If … Read more

Customizing Responsive Themes Menu [closed]

Without getting your hands too dirty, a lot of themes come with a CSS editor built-in so you overwrite rules. Feel free to do this for simple changes, and just be wary that your changes could get overwritten if you decide to update your theme in the future. However, if you feel comfortable going deeper, … Read more

How to make an anchored page in a navigation menu tab

Add this page link in navigation menu with #target_point, example http://example.com/contact#location_map Then add an anchor at somewhere of that page with name=”location_map”. Something like <a name=”location_map”></a> Now when someone clicks on this menu, he’ll be directed to this specific part of contact page.

I can’t click on top menus [closed]

This is offtopic, but since I’m in a good mood with the weekend coming up I’ll answer you anyway 😉 The problem is there because the menu you have chosen to use on the page is meant for links that scroll down on the same page. Therefore a piece of javascript is included by the … Read more

Problem with float:left – unexpected behavior [closed]

Add clear:both; to your title. example: https://jsfiddle.net/wap27kuv/ edit: the code is behaving as it should, floated elements will make the sibling elements that has no clear property align to the side of the floated elements. Setting clear:both to your title, stops the floating behavior. You could also use clear:left and it’d work perfectly in this … Read more

How to add or remove borders in navigation menu?

With CSS 3, you can use the :last-child or :last-of-type selectors: .is-frontend #content-holder .semplice-navbar nav ul li:last-child { border-right: 1px solid #000000; } However, you could flip this around to make it more backwards compatible using :first-child (which is available in CSS2): .is-frontend #content-holder .semplice-navbar nav ul li { border-left: 1px solid #000000; } .is-frontend … Read more

how to make a walker to this (in bootstrap, i try but not work)

I use this navwalker <?php class wp_bootstrap_navwalker extends Walker_Nav_Menu { public function start_lvl( &$output, $depth = 0, $args = array() ) { $indent = str_repeat( “\t”, $depth ); $output .= “\n$indent<ul role=\”menu\” class=\” dropdown-menu\”>\n”; } public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { $indent = ( $depth … Read more