Different menu on different category need advice

This is a good way, Mardov. Another way is to specify the subcategory id in the in_category array which is easier method. For example: if (in_category( array( 2, 4, 5 ) ) { // 2, 4 & 5 can be a category or a subcategory wp_nav_menu( array( ‘menu_class’ => ‘menu’,’menu’ => ‘Visuomenei’) ); } You … Read more

Iterate through each menu item into a shortcode

Skimming through the core file, there are some quick & dirty ways available (untested): ! is_admin() && add_filter( ‘wp_nav_menu_items’, ‘do_shortcode’ ); ! is_admin() && add_filter( ‘the_title’, ‘do_shortcode’ ); ! is_admin() && add_filter( ‘walker_nav_menu_start_el’, ‘do_shortcode’ ); But I would rather target the menu labels directly with for example (untested): /** * Support shortcodes in the menu … Read more

How to create menu in Word Press 4.2.2?

You can find Menus in the Appearance->Menus area in the admin. Are you using a custom theme? If so, it might have menu support. Try switching to one of the default themes. If it still, doesn’t appear, disable all plugins and try again.

Two questions about CSSing inside the menus

If you want your navigation span element to be a block, instead of inline element, just target it via css nav > ul > li > a > span{ display:block; } This is providing your HTML structure looks something like this: <nav> <ul> <li> <a href=”#” class=”menu-link”> <span>Home</span> </a> </li> <!– other list elements go … Read more

Count Level 1 Childs for Custom Nav Walker WordPress

I’m trying to make my logic like this: calling below code inside function start_el( &$output, $item, $depth, $args ) { $this->sub_items = 0; // declared variable as private $sub_items = 0 above inside class if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $args->theme_location ] ) ) { $menu = wp_get_nav_menu_object( $locations[ $args->theme_location ] … Read more

Best way to build a 500 item menu

I get it that the menu is generated via queries, hence the bottlenecks. If things don’t change too often, it’s much more efficient to build it manually (or simply just copy the generated html and paste it back instead of source). If things do change often, cache it.

Menu Responsive

Your nav menu bar responcive while can user bootstrap framework. This like code insert in function.php Bootstrap responcive nav menu wordpress // This code insert in header.php <div class=”container”> <nav class=”navbar navbar-default” role=”navigation”> <div class=”navbar-header”> <button type=”button” class=”navbar-toggle” data-toggle=”collapse” data-target=”#medi-temp-navbar-collapse”> <span class=”icon-bar”></span> <span class=”icon-bar”></span> <span class=”icon-bar”></span> </button> </div> <div class=”collapse navbar-collapse” id=”medi-temp-navbar-collapse”> <?php if ( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)