Forums

custom post types with default categories (5 posts)

  1. markoburns
    Member
    Posted 11 months ago #

    Hi -

    I've creating tumblr style custom post types for video, photo, quote etc.,

    How do I use my default post categories for them, as the different post types could be appearing in the same category?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 11 months ago #

    You might want to look at Post_Formats first.

  3. markoburns
    Member
    Posted 11 months ago #

    no , I need other custom types as well. Post formats is too limited.

    I think i found it -
    'taxonomies' => array('category')

    added to register_post_type

  4. markoburns
    Member
    Posted 11 months ago #

    Any idea how I get the custom post types to appear in archives.php?

  5. markoburns
    Member
    Posted 11 months ago #

    This seems to work for both archives and categories - is this the right way to do this? (It's in functions.php)

    function my_get_posts( $query ) {
    
    	if ( is_home() || is_category() || is_archive() && false == $query->query_vars['suppress_filters'] )
    		$query->set( 'post_type', array( 'post', 'quotes' ) );
    
    	return $query;
    }

Reply

You must log in to post.

About this Topic