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
- How do you get the count of posts in an archive page?
- Display Custom Post Type Fields
- WP_Query to loop a Custom Field, Custom Post Types do not show
- Using Query Posts With Multiple Post Types And A Taxonomy
- How to get the parent’s taxonomy?
- Using new WP_Query in shortcode in a custom field causes the main post content to not display
- How to show posts from multiple post types in a single loop? And display them separately on the same template
- Query not returning CPT posts
- Unable to display multiple post types in same query (WPML WP_Query)
- exclude custom post type by meta key in wp_query
- Query Custom Post by Category
- How to get current post id of a custom post type in a loop using template singel-{custom type}.php?
- Quickest way to get last or oldest post date – WP Query
- ‘category__and’ for custom taxonomy?
- WP_Query and using a variable for ‘cat’=> in the args array = WP Bug?
- How to dynamically build a multiple taxonomy query loop within a post type’s single loop?
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- Unable to get post content from custom post type loop
- Lists Posts from CPT that match the Title of the Page
- Custom query shows custom post types in trash
- Multiple post type queries (with specific arguments for each)
- Remove duplicated values from a loop
- Custom Post Type Loop within Shortcode
- How to insert content from another Custom Post type into Post?
- How to connect two custom post types with nested loops
- Display CPT posts based on specific taxonomy
- WP_Query orderby modified to include custom meta changes
- Query/list all terms and their custom post count
- Show one item per category of a custom post type
- Custom loop with multiple taxonomy queries
- What’s the WP way to load remaining custom posts?
- Polylang non-default language ignores tags in WP_Query
- Problem: wp_query outputs all images on site
- 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
- 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
- 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
- Loop through posts of only 2 statuses
- Trying to add a class to post links
- Can’t change posts per page in WordPress Post Type Query
- Display post from custom post type
- List all Custom Post Type posts excluding certain Taxnomy term
- Query all post types but limit to parents
- 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?
- Find Posts based on Child Post value
- Custom Post Type ‘Event’: Chronological list of recurring events from meta_values in array
- WP query_posts group by meta field related
- Page that lists publications by classifying them by taxonomy
- 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
- Order posts alphabetically with numbers but some of the posts has numbers in the title
- 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’
- Query the title of the page to show posts with matching category in the loop
- WordPress query in which condition uses custom field
- Only show current category post
- Error in WP Query. If variable is empty it is displaying previous post value
- get_post_meta for Custom Post Type ( CPT )
- Main site single-property.php design, as homepage of a multisite
- How To Loop Through list with Custom Post Types
- Custom Post Type + Category archive
- WordPress custom post type
- Post data in separate divs with incrementing class using WP_Query
- Custom Query With Multiple Meta Key Value
- Query Posts From Multiple Post Types
- Fallback if statement based on the number filtered from it
- next_posts_link returns same content of 1st page
- Custom loop won’t work, can’t find problem
- Custom post-type’s pagination not working in category.php
- display custom post type from register taxonomy
- Custom post type and have_posts() return empty result
- show custom post’s post in two different divs [duplicate]
- Quering array of post types & pagination. Articles are repeating sometimes on different pages
- How can I show posts with the same tag?