You seem to be using 2 separate queries there, the first (query_posts) won’t do anything, and the second is the query that will be used. Have you tried:
$args=array(
'category__in' => $cats,
'post_type' => 'profiles',
'posts_per_page' => 10,
'order'=> 'ASC',
'orderby' => 'title'
);
$loop= null;
$loop = new WP_Query($args);
Try that instead of:
query_posts(array( 'category__and' => $cats ));
and
<?php $loop = new WP_Query( array( 'post_type' => 'profiles', 'posts_per_page' => 10, 'order'=> 'ASC', 'orderby' => 'title' ) ); ?>
Related Posts:
- Retrieving 3 latest post from each of 5 different custom post types
- Query for posts in 2 taxonomies
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- pagination not working for category.php (custom post types in categories)
- Pagination not working on custom query on a page
- postsperpage value not being applied
- display news with pictures 3 small and one large (loop)
- How do I correctly query posts from a post ID?
- How to exclude certain portfolios from a loop
- Show one item per category of a custom post type
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Custom loop with multiple taxonomy queries
- Get latest 3 posts from multiple CPT in one query
- Show a Category X’s custom post type on Category X archive page?
- What’s the WP way to load remaining custom posts?
- WP Query with categories only shows one post and ignores the category
- Polylang non-default language ignores tags in WP_Query
- Problem: wp_query outputs all images on site
- Different Ways to Query Custom Post Types?
- Listing all term items alphabetically / sorting loop
- How to display Related Posts based on number of taxonomy terms matched
- Wrapping x posts in html without leaving empty html
- WP Query post__in not returning correct results
- Sort posts in loop by the WooCommerce Membership of the author
- How to make WP_Query not to show irrelevant posts?
- Loop for custom post types filtered by a taxonomy
- How can I group posts by months and years?
- Multiple Custom Post Type queries, how to DRY it up
- Custon Content within WordPress Loop
- Loop increase number
- Using wp_query to modify the loop in index.php for a CPT
- Custom WP_Query doesn’t display all posts
- Query & the_content() is showing in the header
- 3 random images from custom post type, each in a div with a diffrent class
- Control content before and after custom post type loop
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- get_pagination not working on a custom post type query (using WP_Query)
- WP_Query with custom post type ID
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- Loop through posts of only 2 statuses
- find custom post type post by searching its custom field with my string
- FacetWP paging custom wp_query
- display posts of custom post type with custom taxonomy
- Trying to add a class to post links
- Can’t change posts per page in WordPress Post Type Query
- Display the current post in browser as the first post in a loop (for a slideshow)
- Display post from custom post type
- List all Custom Post Type posts excluding certain Taxnomy term
- Query all post types but limit to parents
- foreach loop inside the loop creating duplicates in output
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- How to fetch posts that are stored in the different table than (default) wp_posts?
- Cant’ Display Custom Post Type Title Base on Tax Terms
- Custom Post type showing up in loop, regular posts are not showing up
- Loop for custom-post-type comparing taxonomy terms for “related” posts?
- How do I list a custom field and custom taxonomies for each result in a loop?
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Custom post type pagination error
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- Custom Post Types Not Showing Up In query_posts Result
- What is the most efficient way to execute recursive complex queries?
- Find Posts based on Child Post value
- Custom Post Type ‘Event’: Chronological list of recurring events from meta_values in array
- Sorting the Loop by Taxonomy Value
- Custom Query: Multiple CPTs and a taxonomy filter
- WP query_posts group by meta field related
- Page that lists publications by classifying them by taxonomy
- Custom wp-query display post only today
- posts_per_page in custom WP_Query does not override “Reading” settings?
- Exclude a specific post in a Custom Post Type
- Pin posts to top of custom loop
- custom post type and a “sticky” position taxonomy
- Filtering posts based on three taxonomies
- Pagination Not Working When Used With WP_Query() `offset` Property
- Order posts alphabetically with numbers but some of the posts has numbers in the title
- Use WP_query to match post types based on custom field values
- SEARCH QUERIES – REVERSE OUTPUT
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Error in the page of a CPT file in WordPress
- post_type incorrect for custom post type
- Staggering featured post using ‘sticky’
- Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop
- minimize wp_query call to database
- subtracting the current post form then whole loop, which is generating all CPT titles
- Mix Facebook and Twitter feed into custom posts
- sorting in wp query based on custom field value
- Can I show some specific post rather than latest post?
- Custom post Query and WordPress Post Query Clash
- Query the title of the page to show posts with matching category in the loop
- WordPress query in which condition uses custom field
- WordPress loop add heading before first of type
- Only show current category post
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Error in WP Query. If variable is empty it is displaying previous post value
- Strange behavior on WP_query
- get_post_meta for Custom Post Type ( CPT )
- Main site single-property.php design, as homepage of a multisite
- Imported Content Doesnt Show Up On Frontend
- How To Loop Through list with Custom Post Types