Support » Plugin: Custom Post Type UI » Category menus

  • Resolved foxxweb

    (@foxxweb)


    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

    https://wordpress.org/plugins/custom-post-type-ui/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    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

    Thread Starter foxxweb

    (@foxxweb)

    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

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    You’re going to need to tailor the code to fit your use-case.

    What’s the error exactly?

    Thread Starter foxxweb

    (@foxxweb)

    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?

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    $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
    	)
    );
    Thread Starter foxxweb

    (@foxxweb)

    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

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Awesome to hear, thanks for indirectly helping me find a mistake in my docs page code as well.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Category menus’ is closed to new replies.