How to exclude third level sub-categories from mega menu? (2024 update)

Posted in: Newspaper
Post count: 3

Hi Newspapper Team

I would like to exclude third level sub-categories from mega menu.
Eg :
Cat 1 (mega menu)
– Sub cat 1: show
– Sub cat 2: show
— Sub cat 2.a: hide
— Sub cat 2.b: hide
— etc.
– Sub cat 3: show
– etc.

I’ve read two threads mentioning this possibility by placing and modifying a copy of the td_block_mega_menu.php file in the child theme (https://forum.tagdiv.com/topic/exclude-sub-categoy-on-megamenu/) (https://forum.tagdiv.com/topic/is-it-possible-to-exclude-third-level-sub-categories-from-mega-menu/).

But they are from 2015 and 2018, and in 2024, I can’t find any td_block_mega_menu.php file in Newspapper > Includes > Shortcodes (no shortcodes folder exist).

Thank you in advance for your help,
Best,
Kevin

Post count: 35449

Hi,
The new path top that file is – wp-content/plugins/td-composer/legacy/Newspaper/includes/shortcodes/td_block_mega_menu.php but this will work only for a standard header, if is a cloud header the path is a different one wp-content/plugins/td-cloud-library/shortcodes/header/tdb_header_mega_menu.php unfortunately this file can not be set in a child theme, it will be need to be edited after each theme update or it will be need to make a plugin with a similar shortcode in tagDiv Composer.
Thank you!

Post count: 3

Hi Calin, thank you for your reply.

Sadly I think I use the cloud header, which is better for the performance than the tagDiv Sandard Pack, can you confirm ?
https://prnt.sc/tTUftvy5MWKb

Since 2018, have you developed a feature to exclude the 3rd category level in the mega menu? I imagine this must be a regular request from your customers. Edited content/plugins/td-cloud-library/shortcodes/header/tdb_header_mega_menu.php after each theme update can’t be an option

Best,
Kevin

Post count: 35449

Hi,
Yes, that is the cloud header and indeed most of the time provides better results.
Also you can check the rest of templates, footer, category… and set them from cloud and after that check if you have the tagDiv Standard Pack plugin installed, if you do, then please disable it and check the website if displays shortcodes, if does, then activate the plugin and change those elements (usually are blocks that needs to be replace with flex blocks). If you have the tagDiv Standard pack enabled and you’ll disable the plugin there should be some more improve for the performances.
Thank you!

Post count: 3

Hi Calin,

Thank you for your confirmation, I prefer to stay on the Cloud Template

What about the possibility of developing the functionality to choose the number of levels to be displayed in the mega menu in the future?

I mean, if it prevents your customers from creating 3rd, 4th, n-level categories, this is probably a problem because it limits their ability to attack niche keywords by increasing the depth of their sites.

Best,
Kevin

Post count: 35449

Hi Kevin, I understand what you mean, but for the moment there were only a few request for this option, so this is for the moment still on hold on our list of suggestions to be implemented in the theme.
If this is a must have for you, then you can do a request here – https://tagdiv.com/submit-a-request/
Thank you for your understanding!

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.