Support » Plugins » How to associate a custom post type to a category

  • Hello,

    I have copied a code for creating a custom posts type.
    When I want to display the custom posts I create a page and associate it with the custom posts template file.

    The problem is that this page displays all the posts of that type, though I wish to display only certain posts on each page.
    I was thinking that the right solution would be to associate the custom posts with a category, and when I run a query, to query by category and just to display all the posts.

    Could someone refer me to a source that explains how it is done?
    I’m new to wordpress. Thanks
    Thanks.

Viewing 1 replies (of 1 total)
  • Hi libets,

    Somewhere in the code you’ve copied there is likely to be a call to register_post_type().

    The 2nd parameter of this function supports an array of settings, one of which is ‘taxonomies’. This should be set to the taxonomy you wish to associate the custom posts with (category, tag, custom_taxonomy, etc.) It can be a string or an array of linked post types.

    The full documentation on this function can be found here…
    http://codex.wordpress.org/Function_Reference/register_post_type

    Hope this helps.

Viewing 1 replies (of 1 total)
  • The topic ‘How to associate a custom post type to a category’ is closed to new replies.