Megamenu displays sub sub categories

Posted in: Newspaper
Post count: 63

Hi Guys

Please help, I’ve got a problem with mega menu that I cannot fix.
Here’s the example
Primary Category > Health
Sub category of Health > Women
Sub Sub Category> Health > Women > Pregnancy

My issue is the pregnancy sub sub category is now displayed as sub category in the megamenu drop down. It shouldn’t be there, we have multiple of these sub subcategory and the list just gets endless. How can I restrict the megamenu to display only the first sub category level, not include the second level.
Thanks

Post count: 63

Just in case this got lost yesterday

Post count: 35449

Hi,

Using the mega menu will be display all the post from that category and subcategories from that parent category.
If you are using a cloud header from tagDiv Cloud Library, then you can edit it with tagDiv Composer and adjust a little the mega menu -> https://i.imgur.com/oD9Dx2m.jpg

Thank you!

Post count: 8

Hi Calin,
how can it solve this specific case? (I also need to restrict the megamenu and visualize only the sub cat)
In the screenshot I can see that it is possible to adjust the number of subcategories, but i need to exclude the sub sub cat, not to limit the number of the subcategories
thanks

Post count: 35449

Hi demi4444,

Unfortunately there is no option to excuse the sub-categories from a category in mega menu. For the moment there are only two options for mega menu, with sub-categories or without sub-categories, you can check more in our documentation from here -> https://forum.tagdiv.com/mega-menu/

Thank you for your understanding!

Post count: 63

So if your megamenu doesn’t work properly can other megamenus be integrated with Newspaper and if so, which are compatible with the theme.

Post count: 35449

Hi,

Until now the mega menu is working correctly and in the way it suppose to work (if you do not have a plugin conflict), but if you want to use a plugin for this, you can give it a try, unfortunately we do not tested any of the kind of plugins, therefore we can not recommend one, also we can not provide support for untested plugins.
If you want you can try some of these mega menus -> https://blog.hubspot.com/website/wordpress-mega-menu-plugins also there are many others, you just need to find the right one for you.

Thank you for your understanding!

Post count: 8

Hi Calin,
I investigated and maybe found a solution, but I need to override the td_block_mega_menu.php file in plugins/Newspaper/includes/shortcodes/
How can i do this?
The solution in quite simple: on line 140 of that file, change the get_categories() params from ‘child_of’ to ‘parent’.. so from:
$td_subcategories = get_categories(array(
‘child_of’ => $category_id,
‘number’ => $show_child_cat
));

to

$td_subcategories = get_categories(array(
‘parent’ => $category_id,
‘number’ => $show_child_cat
));

That seems to solve, but how can i override the function in my child theme?

Thanks

Post count: 8

ok,
i copied the td_block_mega_menu.php from wp-content/plugins/Newspaper/includes/shortcodes/ to
wp-content/themes/my-child-theme/includes/shortcodes/ and modified the code as shown above.

@Robert
: I think it solves, please let me know if the solution has issues

Post count: 35449

Hi demi4444, I just test you implementation and for the moment is look that is working without any problems.
Have a nice day and thank you for sharing your solution!

Post count: 63

Hi Demi
Thanks but we don’t run a child theme and at the moment we are looking at other themes. The last update they released crashed our WP server and we cannot afford the down time.

Post count: 162

I tried to do this but in version 11.3 there are changes. The relevant line of code is
1788 in the file
wp-content\plugins\td-cloud-library\shortcodes\header\tdb_header_mega_menu.php

So it is under plugins.

The thing is for those of us who are using child theme how can we ensure that this change will stay?

I do not know of a way to override plugins in the child theme. If one can help it will be great.

Post count: 35449

Hi,
We are sorry for any problems that we caused. Also we have released an updated version – Newspaper 11.3.2. – to fix and prevent this issue in the future.

Unfortunately, for the moment the td-cloud-library can not be set in a child theme, sorry! But using the cloud menu, the subcategories can be set with tagDiv Composer, so it should not bee need to edit the files -> https://i.imgur.com/hNGAzKX.jpg

Thank you!

Viewing 13 posts - 1 through 13 (of 13 total)
You must be logged in to reply to this topic.