WP_Query ignores post_type in category view

Have you tried using get_posts() instead?

 //#get access to post settings
    global $post;
    //#set parameters for extra loop
    $args = array(
    'post_type' => 'mycustomtype', 
    'posts_per_page' => 12, 
    'orderby' => 'date', 
    'order' => 'DESC', 
    'post_status' => 'publish'
    );
    //#get posts 
    $customPosts = get_posts($args);
    //#loop through them
    foreach($customPosts as $post)
    {
        //#set all the loop functions to use data from this post
        setup_postdata($post);
        //#do what you want with the post
    }

Leave a Comment