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

Contact form field in wordpress menu

Well, you’re getting error, because your code is not correct… There is syntax error in this line (You combine string and PHP code in there…): $items .= ‘<li class=”menu-item”>echo do_shortcode( ‘[contact-form-7 id=”1323″ title=”Newsletter”]’ );</li>’; It should look like this: add_filter( ‘wp_nav_menu_items’, ‘your_custom_menu_item’, 8, 2 ); function your_custom_menu_item ( $items, $args ) { if( $args->theme_location == … Read more

WordPress doesn’t recognize submenus as so I can’t style them properly

In your array, have you tried setting depth to 0 or 2? wp_nav_menu( array( ‘theme_location’ => ‘header-menu’, ‘container_class’ => ‘navigator’, ‘depth’ => 2) ) Where 0 should be the default and allow unlimited submenu, and 2 would allow one submenu. I am not sure how this would happen, but if it works, perhaps somewhere the … Read more