0

So I have a Custom Post Type setup and running with no issue. I also have a WordPress menu object as my primary navigation. I added my Custom Post to the main menu and when I click on to the landing page the correct menu item is highlighted. When I however click into an individual custom post, the "Blog" menu item is highlighted.

Anyone got any idea as to what the frick is going on?

Thanks, Ed

1

I'm just shooting in the dark here, but what i think is going on is your menu "thinks" its on the blog page when its really on the "CPT" page? is that about right? if so then you need to select a blog page in the admin section. Under the Settings menu click on the "Reading" sub menu. There you will find two select boxes. I'd suggest you select a specific page for your home page and your blog page. see if that corrects the issue.

I'm not even in the right ball park, please let me know.

  • I already tried that Steve - it didn't work. You've nailed exactly what the issue is though. I'll keep playing around with it. – Ed Bloom Aug 20 '11 at 16:03
1

i eventually managed to track down what's going on here and have worked around it for the moment until I find a permanent solution.

as @Steve Fischer had suspected the menu thinks it's on the blog page while it is in fact on a CPT page. What exactly is happening is that the class "current_page_parent" is being appended to my Blog menu link on CPT details pages.

e.g.

mysite.com/custom-post-menu-link/ - all good - my separate Blog menu link doesn't get the current_page_parent class.

mysite.com/custom-post-menu-link/my-custom-post - my separate Blog menu link gets the current_page_parent class.

For now I just removed my selector rules for .current_page_parent but this isn't a permanent solve - it at least stops the Blog menu link being highlighted incorrectly.

Are CPT pages technically children of Blogs? If so, this seems to be an issue for people in my situation.

Ed

  • So you've actually taken someone's answer, added it as your own, and then 'your' answer has been upvoted.. I Find this incredibly unfair on Steve to be honest, he should get credit for his answer, and in fact get the accepted answer. THIS is the problem you are having. – Lee Apr 3 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.