It’s a bad use of Query you may look at this post
In this case use a secondary query with your own instance of WP Query. query_posts() is not recommanded here cause it overrides the main query.
<?php $args = array(
'post_type' => 'instrument',
'post_status' => 'publish',
'ignore_sticky_posts' => 1,
);
$my_query = new WP_Query( $args );
if ( $my_query->have_posts() ) :
while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
<div class="col-sm-2">
<a href="https://wordpress.stackexchange.com/questions/232360/<?php the_permalink(); ?>">
<?php the_post_thumbnail( 'medium' ); ?>
</a>
</div><!--.col-sm-2-->
<?php endwhile;
wp_reset_postdata();
endif; ?>
Related Posts:
- Get custom post type by category in a page template
- How do you output custom code between posts in the loop?
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Weird problem happening with custom taxonmy when creating/updating posts
- List custom taxonomy specific to one custom post type
- Control content before and after custom post type loop
- Creating a non-hierarchical Taxonomy that behaves like categories
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Compare Two Custom Post Types Using The Same Custom Taxonomy
- How do I ensure that post_type and Taxonomy use the same slug?
- Combine multiple separate lists into one
- Show parent category and subcategory once in while loop
- CPT: multiple loops with different terms
- Add active class to foundation 6 tabs while looping categories
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- WordPress Custom Post Type and sort by Tags
- Order by custom field attribute
- Looping taxonomy in taxonomy?
- Inserting two categories
- Get Custom Taxonomy ID within loop
- Associating an “author” with a custom taxonomy
- TV Show database – Best way for structuring it?
- Categories under custom post types doesn’t show properly
- Query posts by custom post type and custom taxonomy
- List all posts in Custom Post Type but group dynamically by Custom Taxonomies
- How to display the rest of categories on Portfolio filterable
- Error after deleting Custom Post Type with a function (no trash used)
- After deleting a post are terms, and custom meta deleted?
- How to append element after thumbnail
- ‘category__and’ for custom taxonomy?
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- removing custom tax & CPT slug, adding taxonomy term in front of custom type
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- How to customize admin posts based on the user who is logged in
- Show Two custom Post type and their posts on category page
- How to insert content from another Custom Post type into Post?
- Only show posts from a certain category?
- Custom Post Type Loop throws 500 error when used in widget
- get_attached_media() on author page not working
- Custom loop with multiple taxonomy queries
- I would like to have different styles for my posts based on the content of each post
- Checking if Post Title is Unique as Loop Criteria
- Custom post type multiple loop by taxonomy term
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- Hide parent categories when clicked, and show it’s childs
- Group CPT posts by custom taxonomy
- What’s the WP way to load remaining custom posts?
- Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
- get_the_title() is returning results from previous loop
- Including all post id’s of a custom post type into an array
- How can I group posts by months and years?
- Trying to Create a PHP Variable for post_type that can be referenced Site Wide
- Main query not querying any posts in custom taxonomy template
- List Categories (wp_terms) and count posts
- Get custom post type categories to show up in menus
- Displaying multiple post types on home page
- Show current custom taxonomy
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- post_content is stripping HTML when adding a new post? [closed]
- List all Custom Post Type posts excluding certain Taxnomy term
- Add Class according to the order of appearance
- Foreach loop returning more than one item when querying taxonomy
- Loop and add Specific Categories and Products Images
- Custom taxonomy not saving correctly
- How can I increase the post count for custom post types only?
- Related “custom post type” using “custom taxonomy”
- Custom post type page with parameter
- How can I loop at a Specific Taxonomy from a custom post type?
- How do I disable the built-in editor and automatically configure the properties of new pages?
- How to have multiple search result pages in wordpress with taxonomy terms listed
- Custom archive page for custom taxonomy and pagination issue
- Get all post under custom post type grouped by custom filed value in custom taxonomy
- Check that a slug is present in the get_terms request
- Custom post type paging return home page
- WordPress next post by ajax call on button click
- when looping through custom post data not appearing
- How to limit the number of custom posts certain users can publish in WordPress using php script?
- pagination problem listing custom post types of taxonomy in wordpress
- Looping to organize and display custom posts by category using PHP and WordPress
- Set a Default CPT taxonomy by taxonomy id
- My post loop needs to have 8 different post templates
- Multiple Custom Post Type in Taxonomy Archive Causing White Screen
- Adding a Section for Visitors
- Why is my loop not populating the page with my custom taxonomy terms from my custom post type?
- Loop to display parent categories in custom taxonomy
- Display related post content and custom field content
- The most recent post of custom taxonomy
- Show tags of custom post types in WordPress
- Show posts for current taxonomy
- Strange behavior on WP_query
- Custom post type with custom taxonomy permalinks
- Loop multiple taxonomy in custom post
- Post data in separate divs with incrementing class using WP_Query
- Values inside a custom field to determine which category posts to display
- Posts without featured image using other post’s featured image
- Select Menu for Custom post Type does not save
- Building a List of Posts grouped by custom taxonomy as the section header only to be displayed if at least one post is in that tax
- display custom post type from register taxonomy
- Get all active posts that are tied to a custom taxonomy for a custom post type
- Complex Custom Loop with Includes