As Andy said, WordPress will load the correct posts for you. You don’t need a custom query. When you’re viewing a custom post type or taxonomy archive the main loop will already have the correct posts based on the URL.
So you don’t need any of this:
$taxes = array( 'libro_de_hadiz' , 'asunto');
$terms = get_terms( $taxes );
echo $terms;
$paged = ( get_query_var( 'paged' ) ) ? absint ( get_query_var( 'paged' ) ) : 1;
$args = array( 'post_type' => 'hadices',
'posts_per_page' => 6,
'paged' => $paged,
));
$loop = new WP_Query( $args );
Then $loop->have_posts()
and $loop->the_post()
should just be have_posts()
and the_post()
.
Also, you got a bit carried away and added $loop->
where it doesn’t make sense. You should remove it from everywhere else too.
Related Posts:
- Get Posts by Custom Post Type ,Taxonomy, and Term
- How to limit the number of terms (terms acts like categories)
- How do I list custom taxonomy terms without the links?
- wp_insert_term doesn’t work with custom post type’s taxonomy
- Retrieve single term slug
- Get list of terms of current taxonomy archive for another taxonomy
- Get all taxonomies for all post types
- How to check the terms in single custom post type template
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- How do I display the taxonomy for a custom post type in an array
- Custom Taxonomy Terms in Menu lead to which page?
- How to order taxonomy terms by most recent post?
- Get all posts for custom taxonomy term
- Filter Term By Parent Term – Custom Post Type
- Filter By Term Not Working – Custom Post Type
- WordPress add taxonomies/terms list as a menu in archive page
- get_the_term_list() wanting to loop through the returned values
- List custom taxonomy terms
- Display associated taxonomy child name on single CPT page
- Issue On Listing Woocommerce Parent Tag List
- Taxonomy Archive URL + Template
- How to get all taxonomies of a post type?
- Saving Taxonomy Terms
- Display current taxonomy term when inside custom post type
- Get term slug of current post
- How to list custom taxonomy categories?
- Custom Taxonomy Template Post List with Sort Order
- display multiple term post from taxonomy in a single page
- Custom Metabox with Taxonomy Dropdown – Saving Issue
- How to get the parent’s taxonomy?
- If on term-page -> get the current term?
- Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy
- wp_insert_post custom taxonomy
- Display taxonomy term only if there’s a value
- How do I provide a “show all posts” link in a paginated term archive?
- How to output wordpress custom tags separated by comma?
- Problem with custom post types, taxonomy and permalinks
- How to create new category for custom post type?
- Fetch taxonomies by custom post type id array
- get_terms showing all categories instead of the ones assigned to a specific post
- Does WordPress limit the length of slug names for Post Meta or Terms?
- wp_set_object_terms() not adding new term to custom post and custom taxonomy
- Categories of custom taxonomy don’t show any posts
- Custom Taxonomy back-end customizations
- Is it possible to have dedicated page for parent/child taxonomy?
- Display a grid of taxonomy terms at root taxonomy page
- limit value taxonomy based on previous taxonomy value wordpress
- Display Custom Taxonomy Alphabetically
- How to make custom taxonomy into drop down select in a custom metabox
- How to display products name in a non-alphabetical order, in a custom field (taxonomy)?
- Taxonomy in URL
- Listing all term items alphabetically / sorting loop
- How to Set Taxonomy Object Description?
- Custom select query for taxonomies that have posts categorized in another taxonomy
- Variable not working in WP_Query
- Custom Post Types Archives and Single Pages not showing custom taxonomy data
- Alphabetically sort a taxonomy.php template by post title
- Get terms of a post but only if they’re also the child of a specific term
- Show Taxonomies with admin area for custom post type?
- Get taxonomy term by slug in post on archive page
- Custom taxonomy template list not working (404)
- Use the custom post type archive for taxonomies?
- Taxonomy template page not working
- does wp_insert_term link the term to a certain post ID?
- Copy/Move selected taxonomy terms to another taxonomy for posts
- Get posts by category name
- Retrieve Custom Taxonomies with Description and Slug
- How to list posts by term (custom taxonomy)
- Query Custom Post Type by Taxonomy
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- Order posts by taxonomy terms
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- Define multiple prefixes for custom post type
- How to list posts by terms
- How to associate custom taxonomy terms with custom post type?
- Taxonomies are not showing in the category dropdown
- get_the_terms child terms for current post/custom post only
- List all posts associated under custom taxonomy
- Custom Taxonomy – fields
- If custom taxonomy exist on post?
- Get category list & taxonomy list from different post type using post id?
- How to get all posts related to a taxonomy?
- Custom taxonomy- only output relevant terms
- Displaying the Taxonomy and a Queried Term on a taxonomy.php page?
- How to create TEMPLATES for TAXONOMIES? What I have to change in this code?
- Custom Post Status & Taxonomies
- Create an additional template page for every term taxonomy
- Prevent repetitive terms in get_the_term_list
- Displaying taxonomy icon outside archive page
- Taxonomy Grid Archive Help?
- Show taxonomies from specific CPT
- insert a taxonomy for a custom post type
- List a custom post type’s posts ordered by nested custom taxonomy
- Author template – separate custom post type by custom taxonomy term for $curauth
- See the process of creating a taxonomy and tell me where I made a mistake
- How to manage a bookstore
- How to add to taxonomies to a post type
- Filtering custom post types using category taxonomy
- Is it possible for post and custom post type to share a category base slug?
- How to use wp_set_object_terms depending on page ID?