Your post list is repeating because in your WP_Query args you are fetching posts just from the category with ID “2”.
In order to get posts from custom taxonomies you need to use a tax_query inside your WP_Query. You can read more about tax_query here:
https://developer.wordpress.org/reference/classes/wp_query/#taxonomy-parameters
I would do the following:
$args = array(
'post_type' => 'post',
'tax_query' => array(
'relation' => 'OR',
array(
'taxonomy' => 'category',
'field' => 'term_id',
'terms' => 2,//Your WordPress category here
),
array(
'taxonomy' => 'tutorial',
'field' => 'term_id',
'terms' => $taxonomy->term_id,
),
),
);
$query = new WP_Query( $args );
Related Posts:
- Check if a post is in any child category of a parent category
- How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms
- Control term order on a per-post basis
- How can I add the featured image functionality to a custom taxonomy?
- Share one taxonomy across multiple blogs in 3.0 [duplicate]
- Can a Child Category Have More than One Parent?
- Combine two taxonomies in a hierarchical tree
- Admin Panel – Disable Moving Selected Terms To Top of Metabox
- How to make custom taxonomy check boxes like ‘Categories’
- Create terms when registering taxonomy?
- How to create non-unique sub-category slugs?
- How to add HTML5 ‘required’ attribute to wp_dropdown_categories() without JavaScripts?
- How to Override default update_count_callback for category
- Does WordPress Offer a Way to Find All of the Categories that Don’t Have Children?
- Add custom taxonomy terms to WordPress menu dynamically & append #slug to url
- wp_list_categories, Add class to all list items with children
- Getting WordPress custom taxonomy/category?
- Display empty taxonomy terms with get_terms()
- Return category slug / title from category ID
- Connecting WordPress gallery to custom categories (taxonomy)
- How to get the number of child categories a specific parent category has?
- Get term by slug in Gutenberg
- How to get the depth of a category’s subcategories
- New categories are now going to 404s
- Best way to programmatically link to multiple categories (union/intersection) [closed]
- “Reversable” and “Re-useable” Subcategories (or other taxonomic structure)
- Get multidimensional array that reflects category hierarchy
- Want to hide some categories from the categories meta box in the post editor for the two specific user roles
- Can I use get_adjacent_post for specific categories?
- Taxonomy filter all children
- Force a user’s posts category
- Search Posts / Pages with multiple options?
- ACF: Display category name using taxonomy field
- How to get the id from the custom category?
- How to filter out Categories for specific post types on WordPress Admin?
- How can i insert term in a specific language of Polylang?
- Taxonomy name repeating when showing 2 posts from each category
- New Categories Not Shown In the Post Edit Page
- Shortcodes not working in category or tag description
- Display Posts Loop for each parent and for each Child
- How to “group” (categorize) the Pages together?
- Is There a Difference Between Taxonomies and Categories?
- How can I edit the ‘Most Used’ tab in the categories meta-box to show another custom taxonomy?
- Custom taxonomy/category order
- Drop posts from categories in MySql
- Customize category page for different custom taxonomies
- How can I improve this taxonomy treating approach?
- Get posts under a category with SQL
- Display custom taxonomy attached to the post on post single page
- wp_list_pages() exclude category
- How to display parents category and child category separately for a specific post?
- Admin: Navigation Menus do not show empty categories/taxonomies in the list’s search tab
- Display sibling categories on category page
- How to display a value inside a post with a specified category from a category custom field? [closed]
- Echo text using is_tag
- Grandchild Term Things Grandfather Term is It’s Parent
- WP 4.7 in_category change?
- Get posts of a custom post type from category from taxonomy?
- Illegal string offset ‘taxonomy’ in
- Same menu for different taxonomies to reach different content
- Change categories count to include media attachments
- How to get selected taxonomy or category ID if using custom walker?
- Let user select their own category
- How could I write a get_categories_by_year() function?
- Get posts in a subcategory of a chosen parent
- Natural sort / ordering wp_dropdown_categories
- Best way to categorize/populate a magazine style layout
- sidebar troubles, taxonomy trouble
- Displaying posts of given category
- WordPress Default Category and Custom Taxonomy Selected Attribute not Working After Searched in wp_dropdown_categories Array
- Automatically adding tags and categories into Post Excerpt for searching
- How can i add service category here? [duplicate]
- Show subChild categories
- WordPress 5.4 and higher: Filter posts by category 1 AND category 2 in API requests
- How to set the same base url for two different taxonomies?
- Limit categories to hierarchal depth of 2
- Show the parent taxonomy by creating shortcode in woocommerce?
- WordPress Portofolio Conditional Templating – functions php
- Parent Category and Subcategory default text generated with category
- Get WooCommerce product category list in functions.php
- Bulk assign posts to a category using SQL (MySQL)
- outputting taxonomy hierarchy
- Confused about category.php template – not working
- Filter custom taxonomy posts via AJAX
- Why use hierarchical taxonomies instead of many custom taxonomies?
- How to Manage and link certain custom taxonomy?
- Display Taxonomies in loop with template args
- Match two taxonomies to display a specific content
- Display only the latest post
- Return selected categories only in custom page meta box?
- list taxonomy based on taxonomy
- get IDs from links categories
- Multiple Parent Category URLs
- Chained drop-down menu for custom taxonomy using chained.js
- Display only one level subcategory in wordpress
- Converting Categories (with ACF fields) to custom taxonomies
- Taxonomy term RestApi data 10 rows limitions
- Add custom fields to Woocommerce Category Page
- How to make /category/ URL load properly instead of 404 error?
- How to get parent and child sub category (Taxonomy) order to display