Menu item on a category
Menu item on a category
Menu item on a category
Link from outside website or another page to a text widget title
Whenever I add, modify, or remove a menu, my WordPress website does not update unless I perform a CSS regeneration. How can I address that problem?
here an example of how to manage multiple set of options. it needs to be completed by a nonce to avoid CSRF attack and it needs also a little bit of layout. add_action(“admin_menu”, function () { add_menu_page( “Multioptions” , “Multioptions” , “manage_options” // capability to be allowed to edit options , “MY_PLUGIN__multioptions” , function () … Read more
How can I keep a WordPress dropdown menu open when navigating to a child page?
To get a full control of the menu items you can create a custom Walker class, which extends the default Walker_Nav_Menu class. Override and customize the class methods as needed. Finally pass an instance of the custom walker to wp_nav_menu( array $args = array() ) with walker key in the $args array. If you only … Read more
I think with your question to hide the empty product categories in menu, we can add extra class for this menu item then adding CSS to hide these specific items. This code will add extra class hidden to empty product categories add_filter(‘nav_menu_css_class’, function($classes, $menu_item, $args, $depth){ if(‘taxonomy’ == $menu_item->type){ $term_id = $menu_item->object_id; $term = get_term($term_id, … Read more
To ensure the “Journal” menu item is highlighted for single posts without adding individual posts as sub-items in the menu, you can use a WordPress filter and some custom CSS or JavaScript. Here’s a solution that involves adding a bit of PHP to your theme’s functions.php file to modify the menu classes. Step 1: Add … Read more
Firstly, you should absolutely not modify core files. Ever. Any changes you make to core files can and will be overwritten any time WordPress updates. There are umpteen ways in which WP has been written to allow you to change its behaviour without hacking on core files: hooks, filters, APIs. Use those instead. In this … Read more
I checked both of your links and in the <body> tag, both of them have class page-id-1508, meaning that the page id is recognised correctly either with or without the query variable. However, as @mmm suggested in the comment above, it seems that you added the menu item as Custom Link (note the menu item … Read more