Support » Plugin: Custom Post Type UI » Category menus
Category menus
-
I have set up a custom post type and have assigned catgories to the posts. I know wish to create sub-menus to be able to access these categories. The sub-menu doesn’t pick them up though. If I allocate a “normal” post one of these categories the menu does pick them up.
I have checked Categories (WP Core) in the Custom post setup
-
So the category archives aren’t showing the post types posts you’ve created?
If that’s the case, I’d read over http://docs.pluginize.com/article/17-post-types-in-category-tag-archives
Thank you for the response. I think the answer is yes to the question you have asked.
I copied the code into functins.php from your link and I get a parse error against the array_merge line of code
You’re going to need to tailor the code to fit your use-case.
What’s the error exactly?
Parse error: syntax error, unexpected ‘array_merge’ (T_STRING) in
is the code designed to work as is, or do I need to add my Custom posts name?
$query->set( 'post_type' array_merge( array( 'post' ), $cptui_post_types ) );
Exact copy above. Looks like I missed a comma in there after the ‘post_type’.
Amended version below and updated the docs page.
$query->set( 'post_type', array_merge( array( 'post' ), $cptui_post_types ) );
Now works and I don’t mean just the above code I mean the menu option i was trying to create works too!
Thank you
Awesome to hear, thanks for indirectly helping me find a mistake in my docs page code as well.
- The topic ‘Category menus’ is closed to new replies.