WordPress.org

Ready to get started?Download WordPress

Forums

Folding Category List (FoCaL)
custom post type (1 post)

  1. MartinLeclercq
    Member
    Posted 2 years ago #

    I can't see my custom post types in the categories. So the category looks empty. But it's not. When I select the 'cpt' post the assigned category is highlighted!

    I used this code in the functions:

    add_filter('pre_get_posts', 'query_post_type');
    function query_post_type($query) {
    if($query->is_archive){
    if(is_category() || is_tag()) {
    if (empty( $query->query_vars['suppress_filters'])) {
    $post_type = get_query_var('post_type');

    if($post_type) {
    return $query;
    } else {
    $post_type = array('post','my_post_type');
    $query->set('post_type',$post_type);
    return $query;
    }
    }
    }
    }
    return $query;
    }

    It shows the cpt in the category. But FoCaL is not able to see the cpt.

    Has anybody an idea?

    Regards,
    Martin

    http://wordpress.org/extend/plugins/folding-category-widget/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic