
-
AuthorPosts
-
November 9, 2021 at 4:44 am #1328274
Hi Enfold Team,
We met a issue that when we created two pages with the “blog post” element.
We defined the Page A to show the post with category A and Page B to show the post with category B.
When the visitors visit the page A and Page B, the menu item is highlighted correctly.
Please see the image below
https://ibb.co/fXh1q7H (page A)
https://ibb.co/dK3jQ6m (page B)
However, when the visitors visit the post from Page A or Page B, the menu item will only highlight the Page A.
https://ibb.co/qRNvQBx (before visiting the post content)
https://ibb.co/2sjpd9X (after clicked the “read more” button)Would i have any suggestion or patch on this behaviour?
As this may affect the user experience when they are reading the content and find out the highlighted menu item is not corresponding to the content.
Many thanks.For addition information,
we have located the behaviour is due to the logic for applying the “current-menu-item” css class in file “helper-responsive-megamenu.php”.
But we are not sure how to change it to align our customer expectation. therefore we need some advise on this.
Thank you very much.November 9, 2021 at 9:40 am #1328317Hey Chris,
Thank you for the inquiry.
The menu is not highlighted because the page is not actually related to the post or they do not have any connection. This should work if you created a link or menu item for the actual category or archive page, which WordPress automatically assigns as the ancestor of the posts that belongs to that particular category.
In the Appearance > Menus panel, you can add links or menu items for category or taxonomy pages by enabling it in the Screen Options panel.
Best regards,
IsmaelNovember 10, 2021 at 1:31 am #1328403Hi Ismael,
Thank you for the suggestion.
But some existing post still got the wrong highlighted menu, so what we could do to remove the incorrect highlight effect?-
This reply was modified 3 years, 7 months ago by
Chris.
November 11, 2021 at 1:43 pm #1328660Hi Chris,
Could you please create temporary admin logins and post them here privately so we can look into it? Please share some posts that are wrong highlighted as well.
Best regards,
YigitNovember 15, 2021 at 1:32 am #1328990This reply has been marked as private.November 15, 2021 at 2:37 am #1328995Hi,
Thank you for the info.
Looks like you are still using pages instead of the actual archive or category pages. To completely disable the highlighting or to remove the indicator when viewing a single post page, we added this code in the Quick CSS field.
.single-post #menu-item-3867 .avia-menu-fx, .single-post #menu-item-3866 .avia-menu-fx { display: none; } .single-post .header_color .main_menu ul:first-child > #menu-item-3867.current-menu-item > a, .single-post .header_color .main_menu ul:first-child > #menu-item-3866.current-menu-item > a { color: #b5b5b5; }
We also disabled the Enfold > Performance > File Compression settings temporarily. You can toggle it back once you are done checking the page.
Best regards,
IsmaelNovember 15, 2021 at 2:44 am #1328996Thank Ismael, we are still using pages because we did try the category pages before and the behaviour is the same and we found the setting that cause the behaviour.
We have changes the “And where do you want to display the Blog?” to “Press Release” which make the website links up all posts to the menu item “Press Release”. We will enable back the file compression.
Thank you very much.
November 15, 2021 at 6:44 am #1329025 -
This reply was modified 3 years, 7 months ago by
-
AuthorPosts
- The topic ‘Query on Menu highlight behaviour.’ is closed to new replies.