The get_template_part()
function takes filepath relative to the file it is called in. Do you have a folder called ‘content’ which contains a file content-posttype.php
? is the ‘content’ folder located in the same folder as this php file you are calling get_template_part()
in?
Also, you can modify your while loop as follows:
while ( $postsQuery->have_posts() ) {
$postsQuery->the_post();
get_template_part( 'content/content', $postType );//please check the file path.
}
Related Posts:
- Using a custom WP_Query with get_template_part loop
- Check for the main query from the template
- Custom wp_query inside a conditional stament inside a template part doesn’t work: why?
- Continue loop after $queryObject
- Print post data inside loop using theme content template
- First post outside of loop, homepage only?
- Get post count of current loop when using multiple queries on one page
- Show posts without term
- Usage of the new “posts_clauses” filter in WordPress 3.1?
- Display products from specific category in shop page
- get_template_part in for loop
- “pre_get_posts” firing on every query
- Show two random posts from custom post type
- Add the “active” class only to the first loop item in a WordPress query [closed]
- Sort posts by custom taxonomy name
- Loop inside the loop
- Looping through tabular data
- Show default content if custom WP_Query has no posts
- cloning a WP_Query
- How to query ‘posts_per_page’ to display a different blog posts index template?
- Display featured products through custom loop in WooCommerce 3 [closed]
- meta_query on a date range using an array of values
- How is WP_Query connected to WP_Post in The Loop?
- Multiple WP_Query loops with Pagination Not Working
- WooCommerce Only OnSale Products Loop Snippet [closed]
- Apply CSS class to every second database record [closed]
- How to prevent writing duplicate loops?
- Get posts for last working week in WP_Query
- ACF – Get lowest & highest value from field
- query user display_name failed in a custom mysql query foreach
- Multiple taxonomy And acf filter group by
- Reset postdata to custom query in nested queries
- How to Filter Posts by Custom Fields?
- WP_Query condition affects posts_per_page count
- Custom Search Not Consistent with Results
- Display both standard posts in a specific category along with a custom post type in a single loop?
- Orderby is working with one query but not with other
- 1/3 of posts different class
- Two loops on archive page
- Loop Split two Columns
- How to order posts by title after they have already been sorted by category
- How to list posts with disabled/closed comments, with pagination?
- How to make a second query offset -2 from current post
- Running main loop 2 times with conditional statement
- WordPress | Date not always appear [duplicate]
- Array as ‘key’ in WP_Query
- Is_single() conditional tag returns null in query
- Best choice for multiple loop in page?
- WP Query – order posts by meta field first and then order the rest
- Wp_query with 2 meta keys and array of meta values
- How to create custom query by keyword in post title?
- Create a loop on my pages with new “WP_Query”
- WP ForLoop to compare meta information of posts to determine what post to display
- How to filter query loop block with a search string from the query parameters
- inserting content of 1 Post to in another with a template hierarchy
- Different Loop for tag pages?
- Pagination for custom loop on custom page template is not displaying anything
- Filtering by multiple conditions in the loop
- How to access $wp_query object from array of posts given by get_posts?
- Display all attached image of every post of custom post type and link to original post
- 2 queries with counters
- Writing less unnecessary code with WordPress
- Search.php – return number of results but cannot loop through
- Creating ‘posts page’ loop based on the page itself
- WordPress Queries Not Working?
- Filter subpages in while loop from WP Query object
- Use have_posts() with array of post results retrieved by $wpdb->get_results
- Custom query does not find pages
- How to sort by most watched in X days/months
- Magazine style frontpage with multiple categories/loops and no duplicate posts
- How can I use arrays and a foreach to generate many lists with WP_Query?
- How to use custom page for all posts with custom url, call another directory?
- display ACF repater field in archive page
- Duplice post with standard WP loop – fixed by using query_posts() instead
- WP_Query breaking the loop in a nested loop
- Check the stored / cached WP_Query with transients on post change
- New template file does not load category-specific post
- Related posts queries
- Get categories within specific term
- Custom query for custom post type not getting correct post ID
- Query post with content only
- update_post_meta() not updating
- Why is my query not giving results?
- why default wordpress loop not working outside index.php
- how to show more than 1 post into three columns query
- active link for most recent post on vertical tabs
- custom query – offset to pagination
- WP_Query for attachments without duplicating post_parent and displaying tagged image
- List ALL posts within last week from current category on category page
- loop through custom post types with meta data
- Using Query In Post Type Archives
- How ‘secure’ are loops?
- Multiple loops on index page with sticky post and pagination
- How to do a loop inside a loop?
- tax_query not working properly with get_posts
- the_excerpt() not working in custom archive
- How can I display sticky posts at first in wp_query?
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise
- Prevent WordPress loop from displaying similar post titles
- Custom WordPress loop, articles not in same order as Array