Change font and Colours in Menus

Goto your dashboard > appearance > customize there you can find some options to change button color,font size etc. To target your ul in menu you need to use below class: ul.nav-menu To target the li a of your menu use below class : .menu ul.nav-menu li a To target you ul under the parent … Read more

Add subemenu option page

I am sure other people could point out other methods, but I’m just putting here what I consider to be the fastest method: use Advanced Custom Fields PRO and their option pages functionality. From their documentation: if( function_exists(‘acf_add_options_page’) ) { acf_add_options_page(array( ‘page_title’ => ‘Theme General Settings’, ‘menu_title’ => ‘Theme Settings’, ‘menu_slug’ => ‘theme-general-settings’, ‘capability’ => … Read more

Incorrect Behavior on WordPress Main Menu

I think you forgot to set the menu location. Below the menu (depending on the used theme) – right below that what your image shows are one or more checkboxes “Location in the theme”. Select the “primary” menu If no menu location is selected, the fallback is to show every page in hierarchical order from … Read more

Admin – Custom Post Type in WooCommerce menu – how to control menu order

menu_position is not used when you set show_in_menu to a submenu. to put your menu in last position there is 2 solutions. The first is to change the menu construction priority like this : add_action(“admin_menu”, function () { remove_action(‘admin_menu’, ‘_add_post_type_submenus’); add_action( ‘admin_menu’, ‘_add_post_type_submenus’, 200); // 200 to set it after the last element of WooCommerce … Read more

Getting parent object_id of child menu items in WordPress menu

I made 2 mistakes in my comment. try rather this code function data_attribs_menu( $atts, $item, $args ) { // check if ACF exists if( class_exists(‘acf’) ) { $page_section = get_field( ‘page_section’, $item->object_id ); if( $args->theme_location == ‘header-menu’ ) { if( $item->menu_item_parent == 0 ) { $atts[‘data-color’] = $page_section; } else { $parentItem = get_post($item->menu_item_parent); $parent_page_section … Read more

Custom Walker menu depth opening problem

I Try to find how to collapse all cat by default in other word In that case, then try this script (replace the one you have now): <script> ( function ( $ ) { $( ‘li.has-children’, ‘#cat-drop-stack’ ).on( ‘click’, ‘> a span.caret-icon’, function ( e ) { e.preventDefault(); var self = $( this ), submenu … Read more