Support

Account

Home Forums Feature Requests ACF post types taxonomies useless unless…

Unread

ACF post types taxonomies useless unless…

  • I love the new Post Types function of ACF, i could stop use other plugins for it.

    But the Taxonomies feature is little limited – even if you select e.g. Category taxonomy for a custom post type and you can then set this taxonomy for a post type, it does not mean the post does appear on the category page, unless you update wp_query, like this


    add_filter('pre_get_posts', 'query_post_type');
    function query_post_type($query) {
    if( is_category() ) {
    $post_type = get_query_var('post_type');
    if($post_type)
    $post_type = $post_type;
    else
    $post_type = array('nav_menu_item', 'post', 'movies'); // don't forget nav_menu_item to allow menus to work!
    $query->set('post_type',$post_type);
    return $query;
    }
    }

    It would be great if users could just allow it in the ACF Post Type admin

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.