0

In Settings-Reading I have selected a static page from my "Front page displays". My Front page is "Home" and my Posts page is "News".

I have also added a Custom Post Type called "Project" without an archive or a slug and I have added a page "Projects" which uses the template projects.php.

So far so good, all is working, except one thing.

When I visit a single Project (CPT), in my top navigation "News" becomes selected. In the body-tag it gets the class single single-project postid-114 single-format-standard logged-in

And in the nav-menu News has a class of page_item page-item-6 current_page_parent.

I don't understand why this (News getting the current_page_parent-class) would be happening, as I expected that none of the page_items would become selected.

Two questions:

  1. How can I get rid of this?
  2. And ideally, how can I make it so that "Projects" becomes selected?

Below a screenshot to (hopefully) clarify things.

enter image description here

1

1 Answer 1

0

Might be worth looking at the Codex for registering a post type, the rewrite rule should help:

http://codex.wordpress.org/Function_Reference/register_post_type

rewrite (boolean or array) (optional) Rewrite permalinks with this format. False to prevent rewrite. Default: true and use post type as slug $args array 'slug' - prepend posts with this slug - defaults to post type's name - use array('slug'=>$slug) to customize permastruct 'with_front' - allowing permalinks to be prepended with front base (example: if your permalink structure is /blog/, then your links will be: false->/news/, true->/blog/news/) - defaults to true 'feeds' - default to has_archive value 'pages' - defaults to true

You probably want to set with_front to false.

1
  • Thanks @Alex, I probably totally messed up here, I should indeed do something with it, otherwise I end up with the default values. Don't know what I was thinking!
    – user2015
    Commented Jun 23, 2011 at 9:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.