Remove pagination from WooCommerce product categories on admin edit navigation menus

Based on “Remove Pagination in Appearance -> Menus -> Categories“ answer thread for WordPress categories, you will adapt the answer code to WooCommerce Product Categories. The taxonomy of WooCommerce Product category is product_cat. Is also better to target admin nav menus only. Try the following (untested): add_filter( ‘get_terms_args’, ‘admin_nav_menu_show_all_product_categories’, 10, 2); function admin_nav_menu_show_all_product_categories( $args, $taxonomies … Read more

How do I prevent the text overflow in menu?

If you use your browser’s inspector f12, you can see your list items have this CSS applied… .sf-menu li { white-space: nowrap; } You need to change it to… .sf-menu li { white-space: normal; } If you already created a child theme you can make the change there. Otherwise, in the admin go to Appearance … Read more

Settings page above CPT page in admin section

you can use the menu_order filter hook to change the order function custom_menu_order($menu_ord) { if (!$menu_ord) return true; return array(‘settings_page.php’, ‘edit.php?post_type=CTP1′,’edit.php?post_type=CTP2′,’edit.php?post_type=CTP3’); } add_filter(‘custom_menu_order’, ‘custom_menu_order’); add_filter(‘menu_order’, ‘custom_menu_order’);

WP_nav_menu fallback not working

You’ve not added a fallback_cb key to the argument array. You also need to add a theme_location key: php start $menu = wp_nav_menu( array( ‘menu_class’ => ‘reset sf-menu’, ‘container_id’=>’nav’, ‘echo’=>0, ‘fallback_cb’ => ‘mytheme_fallback_function’ // ADD ME!!! ‘theme_location’ => `location_name` // ADD ME, AS DEFINED IN register_nav_menu() ) ); $menu = str_replace(“\n”, “”, $menu); $menu = … Read more

Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page

I found an answer by searching in similar posts and links. I added a line to fit my needs (I wanted to prevent my blog page to get highlited when on a custom post).See this line: unset($classes[array_search(‘current_page_parent’,$classes)]); Solution function add_parent_url_menu_class( $classes = array(), $item = false ) { // Get current URL $current_url = current_url(); … Read more

Setting a Default ‘Theme Location’ When Creating a Menu

You need to first collect the menu locations, then set the primary menu location with the menu id. // Set the menu to primary menu location $locations = get_theme_mod( ‘nav_menu_locations’ ); $locations[‘primary’] = $primary_nav_menu_id; set_theme_mod ( ‘nav_menu_locations’, $locations ); Here I assume ‘primary’ is theme location referring to ‘Primary Navigation’.