Adding current-menu-item to custom post type single page
-
Hi,
Believe me when I say I’ve searched for a solution for this. I’ve tried numerous code snippets but none have worked.
I have a custom post type of ‘news’ with ‘archive-news.php’ and ‘single-news.php’. When I add post type menu archive item to the main menu and visit the news archive page ‘News’ is highlighted in the menu using the ‘mega-current-menu-item’ class.
When I click on a news article post the URL changes from domain.com/news to domain.com/news/article-title but news link isn’t highlighted anymore.
I can’t find a solution that will add the ‘mega-current-menu-item’ class to the News menu item when view the news article.
Hope this makes sense and someone can point me in the right direction.
Thanks
Wayne.
- The topic ‘Adding current-menu-item to custom post type single page’ is closed to new replies.