You have a couple of issues with your code.
-
You have to set your loop to your custom query. As it stands, it is set to the main query
-
You must always reset postdata with all instances of
WP_Query
Your code should be something like this
<?php $args = array('post_type' => 'textorial');
$query = new WP_Query( $args );
while ($query->have_posts() ) : $query->the_post();
get_template_part( 'content', 'textorial' );
endwhile;
wp_reset_postdata(); ?>
Related Posts:
- Newer/Older posts links display same posts on every page
- How do I write this SQL statement for Posts written in last 24 hours?
- How to show related posts by category or custom post type?
- How to create posts (not post template) to be displayed on projects page?
- IF statement in a do_shortcode
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- Loop on front-page.php
- How to get all posts except for one post from a certain custom post type?
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- I would like to have different styles for my posts based on the content of each post
- List custom taxonomy specific to one custom post type
- Shortcode not working with post counter
- Conditional for a Single Post That Belongs to a Category?
- How to Make infinite loop of post
- WP_Query with custom post type ID
- display posts of custom post type with custom taxonomy
- Get post format
- Custom wordpress loop
- displaying content of custom post type
- Posts are not rendering perfectly [closed]
- Display post from custom post type
- Use post in multiple places on a page with multiple posts
- The loop does not show users
- How to fetch posts that are stored in the different table than (default) wp_posts?
- If/Else child list for Custom Post Type single template within loop?
- SEARCH QUERIES – REVERSE OUTPUT
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- subtracting the current post form then whole loop, which is generating all CPT titles
- Display title of all custom posts from same taxonomy term on a custom post template
- Custom post Query and WordPress Post Query Clash
- Only show current category post
- How To Loop Through list with Custom Post Types
- How to create content automatically when a post is published?
- Turn post into simple slideshow
- Pulling in a particular post into a single page based on the post id passed into the code
- Styling first post using Advanced Custom Fields
- the_content() stop images being pulled through
- Submit post and upload image from front-end
- Linking Two Post Types
- Pull Two Posts Into Custom Post Type `single-cpt.php`
- WP_Query to loop a Custom Field, Custom Post Types do not show
- Why is the »_builtin« parameter not advised in »register_post_type()« for custom post types?
- How to display the rest of categories on Portfolio filterable
- Query Custom Post by Category
- ‘category__and’ for custom taxonomy?
- WP_Query and using a variable for ‘cat’=> in the args array = WP Bug?
- Shortcode for display posts on home page show only one post
- How to Separate CPT From Regular Posts?
- Remove rows in the manage post/page view
- Only show posts from a certain category?
- Display only one post each WEEK
- Custom loop with multiple taxonomy queries
- Custom post type conditional in loop
- WP the_posts() on single-cars.php get category link
- Main query not querying any posts in custom taxonomy template
- Get_the_terms restrict output
- Generate new post from email
- YOAST SEO won’t work on custom post type archive [closed]
- Add more than one custom post type to wordpress home page post loop
- Different post title, keywords and description
- Trying to add a class to post links
- how to get options to choose post format in add new post
- Loop and add Specific Categories and Products Images
- Making a form for user to add new custom post with custom taxonomies and custom fields
- How can I increase the post count for custom post types only?
- posts_per_page in custom WP_Query does not override “Reading” settings?
- Display Parent-Child Posts in specific order by comparing IDs in array
- Custom post type paging return home page
- How to display custom field in product description?
- How to display posts with plugin (advanced custom fields) field groups?
- WordPress – display relationship between blog posts and custom posts
- Multiple Loops In Tabs Only Displaying First Loop
- Is there a way to create a sidebar of bullets
- Get queried object for custom post type count
- post_type incorrect for custom post type
- Skip latest 3 posts from loop
- Staggering featured post using ‘sticky’
- How can I get the last 5 element of this tax query?
- How to get the posts that my following users are liked?
- How to insert post 6 times after user register like ask.fm
- Sort loop by custom field from different post type
- Creating custom post type relationships
- How to mark posts as visited
- Show posts for current taxonomy
- WordPress loop, show only one post per custom field
- How to Fix Custom WordPress Loop with Pagination on Single Post View?
- Adding Information To All Posts Screen
- erase post excerpt limitation [×]
- Loop multiple taxonomy in custom post
- $post breaking container loop
- Get result from Custom Field in Custom Post type
- Custom post-type’s pagination not working in category.php
- Custom My account page and custom page for editing posts
- why get_post_meta is returning 0?
- Show search for data extracted from metabox
- Get post from custom post type that title is like custom string [closed]
- Get all active posts that are tied to a custom taxonomy for a custom post type
- How to make a non-public post on wordpress approval?
- Filter page ID outside the loop and order
- is therer any wordpress function to retrieve a specific html element from post content