• Resolved Andrew Natoli

    (@andrewnatoli)


    After upgrading to WordPress 3.8 from 3.7.1, a wp_query I made to fetch a custom post type stopped working.

    I registered a custom post type, “portfolio,” and used a plugin to change a bunch of existing posts to the new custom type. Originally to get this query to work I had to include the category ID they were originally in before I changed their type.

    I’ve tried running the query without the category and nothing is returned.

    $port_query = new WP_Query( array("post_type" => "portfolio", "cat"=>3, "showposts"=>12, "orderby" =>"rand") );
    			    while ($port_query->have_posts()) : $port_query->the_post();

    Thanks in advance for offering any assistance.
    -Andrew

Viewing 1 replies (of 1 total)
  • Thread Starter Andrew Natoli

    (@andrewnatoli)

    FIXED

    Apparently 3.8 fixed the initial issue I was having where I had to use “cat.” Removing the categories would also cause the posts to disappear from the backend in 3.7.

    I temporarily re-enabled category support for my post type and then removed the original categories from all of my posts.

    They appear in wp_query results again and still exist in the backend and on the site.

    Woo!

Viewing 1 replies (of 1 total)

The topic ‘Custom post types with wp_query in 3.8’ is closed to new replies.