Megamenu Exclude 2nd level subcategories

Posted in: Newspaper
Post count: 45

Hi,

In Megamenu I want only to show first level categories and reorder them, right now it is listing sorted with recent to oldest.

Please tell me how can i exclude 2nd level subcategories from category Megamenu.

Thanks

Post count: 23312

Hello sanny,

If you want to show only the first level categories, please notice that you will have to do this modification in td_block_mega_menu.php, like this -> http://screencast.com/t/Pkvn5QEdGm
For your second request, if you want to sort the categories from your mega menu, the subcategories are displayed in alphabetical order, if you want to change this order you could try to use a plugin like Category Order and Taxonomy Terms Order as I saw that many users use it.

Thanks!

Post count: 3

Hey Catalin,

This solution worked great for the desktop version, but for mobile (without using the Mobile Theme) these second level categories still show. What files do I need to edit in order to exclude them there too?

Regards

Post count: 23312

Hello itourisme,

Please notice that the Mega Menu feature is not working for Mobile devices, but only for desktop mode. In that way has been designed our theme and this is the normal behaviour for it. If you refer to something else, please provide more details so I will be able to provide a more accurate response.

Thanks for your understanding!

Post count: 3

Hi Catalin,

Thanks for getting back to me so quickly. I understand that the Mega Menu is not working on mobile, but it seems to me like there is no separation between the source of the desktop and mobile menu, meaning while I have now successfully hidden the second level categories in the desktop menu, they are still displaying in the mobile menu.

Is it possible to separate the two and specify one menu for the desktop version (the Mega Menu) and one menu for the mobile version?

or

Can I somehow hide the second level categories in the mobile menu?

Thanks!
Peter

Post count: 23312

Hello itourisme,

If you are using the mobile theme you will have to set your main menu as you like from the panel, like this -> http://screencast.com/t/Sth6v2EunKYc Otherwise, if you are using the general responsive mobile version, please notice that you will have to do one more change, like this -> http://screencast.com/t/3EEpNn2jJMX

Thanks for your message!

Post count: 3

Hello Catalin,

Thank you that solved it!

Regards

Post count: 17

Hi Catalin, what mus I change in the below code for show only two levels of categories?, thanks in advanced.

if (!empty($show_child_cat) and !empty($category_id)) {
$td_subcategories = get_categories(array(
‘child_of’ => $category_id,
‘number’ => $show_child_cat
));

Post count: 23312

Hello Ignacio,

Sorry for this but please notice that it is not a simple way to do this and you should make additional customizations in order to achieve this, sorry! Notice that task is not a simple one and required to make some additional customizations and we cannot provide something like this at the moment, sorry! If you are not aware of the steps which are needed to take in this regard, please consider hiring a freelancer/developer to help you because we cannot provide custom work at the moment, sorry!

Thanks for the message!

Post count: 2

This answer seems not valid anymore, i don’t found the /includes/shortcode directory or get_mega_menu_subcategories function. Thanks.

Post count: 2

New location: plugins\td-composer\legacy\Newspaper\includes\shortcodes\

Post count: 35449

Hi,

Since Newspaper v9.7 a lots of files was moved in td-composer, you need to look for this files in wp-content/plugins/td-composer/legacy/Newspaper/includes/shortcodes/td_block_mega_menu.php and wp-content/plugins/td-composer/legacy/common/wp_booster/td_menu.php

Hope this will help you!
Thank you!

Post count: 10

Hey Calin,

I did the alteration to “parent” and it worked. But now, few days later, I added a new 2nd level subcategory under a subcategory, and now this new 2nd level subcategory is showing in the Mega Menu. And only this one; the others are not showing.

Also, I went to check and there´s no td_block_mega_menu.php in “/legacy/Newspaper/includes/shortcodes/”. The “/common/wp_booster/td_menu.php” is there.

Any hints so my Mega Menu shows only the 1st subcategories?

Post count: 18283

Hello !

Please note that the options presented above by my colleagues are custom work. Unfortunately in the meantime some files have changed their position andwe’re not sure that this still works as it should.

Please note that custom work is not covered by the support team.

Thank you !

Post count: 38

whats this change, i cannot see link screenshot

Post count: 35449

Hi,
The screenshot is this one https://i.imgur.com/k7fsgWQ.png but it is possible that the current version to no longer be the same as it was when this solution has been provided.
Thank you!

Post count: 17

ok, thanks, I try it in our franchise portal https://www.spfranquicias.com/

Post count: 35449

Hi Ignacio, I see that you have on https://www.spfranquicias.com/ only the simple menu elements, so there is no need to implement anything.
Thank you!

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