adding an options menu that allows saving multiple sets of said options

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 to get the navigation menu items? [closed]

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

Hide product categories if empty by leaving them positioned in the same place in the menu

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

How to highlight blog page menu item for blog posts?

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

How to Customize the Admin Sidebar Menu in WordPress Multisite Network by changing the backend code of the wp-admin code files?

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

Primary menu item is not highlighting when page is active even though it is linked from a url with query string to pre-populate a form field

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

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