Page dependent sub-menu?
Page dependent sub-menu?
Page dependent sub-menu?
You are almost there, see comments in code below… function wp3456789_wp_nav_menu_objects( $items, $args ) { foreach( $items as &$item ) { $image = get_field(‘icon’, $item); if( $image ) { // Your original code which appends html string to current $item->title //$item->title .= ‘<span class=”inline-img’ . $item->class . ‘”><img class=”style-svg” src=”‘ . $image[‘url’] . ‘” width=”” … Read more
Possible to append class to nav menu added to widget area?
yes, of course it is possible to do. Here is the code to get all the categories on a page load, this code is prepared to go until the 3rd category generation. $cats = get_categories( array(‘taxonomy’ => ‘product_cat’, ‘hide_empty’ => true) ); foreach ($cats as $key => $cat): if ($cat->parent == 0): echo $cat->name; foreach … Read more
Embedding an external webpage within a page? Is it possible, is it a good idea?
I’m trying to remove a duplicate menu, which only appears on the homepage?
How to show only the last two categories in a menu?
How do I add 3rd level of dropdowns to wp_nav_menu array?
Top bar menus not showing on mobile
UPDATE As per the comment, here is the updated solution. Note: Before copy pasting, don’t forget to change somePrefix with any other prefix to avoid conflict with any other shortcodes. Step 1: Make sure you have this filter in functions.php (If not, copy paste it there) add_filter(‘wp_nav_menu_items’, ‘do_shortcode’); Step 2: Use this snippet to return … Read more