First thought: you shouldn’t be using query_posts
. I can’t think of any situation where it is appropriate to use it. As stated succinctly in the introduction to the Codex page:
Note: This function isn’t meant to be used by plugins or themes. As explained later, there are better, more performant options to alter the main query. Double Note: query_posts() is overly simplistic and problematic way to modify main query of a page by replacing it with new instance of the query. It is inefficient (re-runs SQL queries) and will outright fail in some circumstances (especially often when dealing with posts pagination). Any modern WP code should use more reliable methods, like making use of pre_get_posts hook, for this purpose. TL;DR don’t use query_posts() ever.
Additionally, showposts
is deprecated and has been for a long time, by which I mean seven years.
Switch to WP_Query and see whether something like the following works:
<?php
$args = array( 'post_type' => 'my_custom_post_type', 'posts_per_page' => 3, 'cat' => '185' );
$wp_query_current = new WP_Query( $args );
while ( $wp_query_current->have_posts() ) : $wp_query_current->the_post(); ?>
<!-- Do stuff -->
<?php endwhile; wp_reset_postdata(); ?>
If the problem persists, then come back to us with a more detailed description of what you’re doing, because “etc.” doesn’t really tell us anything much.