3

Anyone know why my categories stop being nested in the product categories widget within appearance > menus? They begin nested, but stop after Age 4 to 6.

I have a set of woocommerce product categories that follow a parent child structure. In the image below, I have a parent category of English Workbooks with child categories of Grammar, Spelling etc. I want to build a menu from my woocommerce categories. To do this, i have created a menu and want to now select woocommerce product categories from the left under "Appearance > Menus". Because i have them all organised in a parent -> child format, when i open the product categories list, the parent > child structure stops working after "Age 4 to 6" and turn into a flat list start "English, Maths, English, Maths etc,etc". This makes it impossible to select the correct categories as i dont know which ones to select.

How do i make the product categories selector in appearance > menus match the parent > child structure i have defined in my product categories?

Appearance > Menus Product Categories

  • did you found some workaround this? I am having the same issue in wordpress v4.7.4 – sheetal May 15 '17 at 18:13
  • Can you confirm you get this issue only to the WooCommerce categories and not to the WP Post categories? – ClemC Aug 25 '17 at 11:47
  • Also, could you screenshot the HTML source of the menu? This might be revelator. – ClemC Aug 25 '17 at 12:16
  • Also, can you make more clear in your question, are these "English", "Maths" category names duplications intended or it's part of the issue? – ClemC Aug 25 '17 at 12:18
  • 1
    @ClemC, this is an issue with all WP hierarchies in the Appearance > Menus, I for example have this problem with nested Custom Post Types. It still repros on WP 4.8 and it seems the issue is at least 7 years old :( I've posted a workaround I found on a WP issue thread. Note: I placed the bounty on this (older) question – Dan Burzo Aug 25 '17 at 13:29
4

Seems to be a long-standing issue. This plugin seems to do the trick.

I've also found an alternative solution (which I've posted in the thread). Reproduced below:

<?php
  add_filter( 'nav_menu_meta_box_object', 'disable_pagination_in_menu_meta_box', 9 );

  function disable_pagination_in_menu_meta_box($obj) {
    $obj->_default_query = array(
      'posts_per_page' => -1
    );
    return $obj;
  }
?>

Update: Needs to be added with priority 9 to work well with the default filter _wp_nav_menu_meta_box_object

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.