Custom Post Types and Category Archives

Community Forums Forums Design Tips and Tricks Custom Post Types and Category Archives

This topic is: resolved

This topic contains 2 replies, has 3 voices, and was last updated by  01themas 1 year, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #40708

    Post count: 17

    I have created a custom post type for my website listing the services available.  I am using categories for the custom post type and I can’t seem to figure out how to show the service cpt in the category archive.  It just says no posts match your criteria.  Any ideas?

    Post count: 9704

    Just noticed your footer links not working.

    I think you may have setup your custom post types incorrectly but hard to say from here. I may be wrong.

    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials


    Post count: 1

    Try something like this to be able to have categories  displayed across all CPTs:

    //enables categories to be used across different post types
    add_filter(‘pre_get_posts’, ‘query_post_type’);
    function query_post_type($query) {
    if(is_category() || is_tag() || is_home() && empty( $query->query_vars['suppress_filters'] ) ) {
    $post_type = get_query_var(‘post_type’);
    $post_type = $post_type;
    $post_type = array(‘post’,’business’, ‘academic’, ‘partners’, ‘people’, ‘facilities’,’programs’ ,’nav_menu_item’);
    return $query;

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.