Well, I’ve achieved it just adding the post type to arguments on WP Query:
$args = array (
'post_type' => $post_type,
'post_status' => 'publish',
'name'=> $newSlug
);
$wp_query = new WP_Query( $args );
And done!
Related Posts:
- Jquery Slider for profile template
- How to get_template_part using AJAX?
- Load featured article once in a loop
- if ( is_home() && ! is_front_page() )
- AJAX with loop filtering categories
- Is including the loop necessary for page.php? [duplicate]
- What is best way passing variables to theme templates and using them different places like widgets?
- pop-up lighbox with AJAX
- Ajax loop in sidebar to load post titles/categories
- Filtering posts by multiple taxonomies
- Ajax loop refresh on click
- Add Infinite Scroll to Ajax Loaded Category Query
- Load comments per post on click with AJAX
- Page template not displaying
- Chopping up a large ajax request of around 200 posts [closed]
- Loop through pages with specific template
- Category Ajax call
- wp alchemy multiple image uploader output images to template
- code suddenly appearing from my tempate second loop
- Get search.php results in header.php?
- WordPress Loop inside Loop?
- How do I use AJAX Query in my posts loop?
- Template structure
- How to show “teaser” posts on blog / archive pages, otherwise full posts
- Order archive results by post id in custom taxonomy template
- Ajax Button to load more Posts into a timeline
- Default ‘post’ post type archive slug?
- Shortcode in posts called by ajax is not working
- How do I make a variable available inside partials?
- 404 Template customization | Want 10 recent Post on the 404.php error page apart from the error Notice
- Scrolling Posts with Ajax
- Get post offset/posts page offset in single post page (outside the loop)
- Second Loop Showing Only One Post on Single Post Page
- How do I put my frontpage featured image in a page template for home.php?
- Get markup for post without loading into the template
- Fetching posts from wordpress function in ajax
- excerpt not showing up
- new custom theme – posts displaying on top of one another
- How do i create a list-posts-page?
- Using jQuery .after inside loop
- Getting selection of posts based on loop variables via Ajax
- How to sort a loop after most viewed
- How to loop specific Category menu from archive page?
- How do I set the Stewart Search Template to return only published posts in the result
- Is it possible to set archive.php instead of index.php to display blog?
- Using is_page_template inside loop
- Loop order issue with Ajax filter
- $post is undefined in wordpress loop [ajax]
- Database query and get_user_meta return incorrect data
- Submit form for loop of products of the term with AJAX
- Get gallery in loop through ajax
- is it bad to copy the loop for a template?
- Is “the loop” a template tag?
- How to avoid appending “null” in Ajax?
- How to manually define the primary loop
- Deeply Nested Menu Loop with Twig using Timber [closed]
- WordPress with woocommerce custom query
- Alternative layout the loop
- Cant pull in featured Image
- Template included with plugin doesn’t return all posts for custom taxonomy
- Creating a archive for taxonomy terms, not the term results
- Ajax category pagination problem
- setup_postdata in “loop-handling” php file called via $.ajax
- Secondary loop cuts off at 10 posts?
- Need a conditional to test if title of parent page matches title of child page
- get all page templates
- wordpress showing all posts instead of date range
- How to implement template file and the loop
- AJAX in wordpress theme loop
- Same posts within a paginated page
- How can I create an entirely new, separate display of posts?
- Get post content from outside the loop
- Is it possible to define a template for a custom post type within a plugin independent of the active theme?
- How to Change Loop to Order Posts by Views (using wp-postviews plugin)
- Is `query_posts` really slower than secondary query?
- Are there any scenarios where the query_posts may be used?
- Related Posts loop – offset
- Display date only once for a each set of posts relating to that date
- Generating dynamic Tabs with multiple query post loop
- How do I override part of the main loop in my child theme?
- Combining the_excerpt with the_content
- Recent posts on a static home page
- I write simple wordpress loop for taxonomy.php file but don’t show result
- How to add a specific div element to the first post in a row?
- Simple foreach loop help needed in wordpress “the loop”
- Assign a template to a custom post type when displayed by the main loop on the home page
- Split loop into columns
- get_posts() forcing ignore sticky posts on main loop
- Ajax Call in page theme not working?
- How to filter posts by category INSIDE the loop
- Help with if and else statement
- I want to load post in bootstrap Modal dynamically
- How to display just video post format?
- modifying the loop multiple times with arguments passed through ajax to wp_query
- How to execute custom loop before loop content?
- Sorting posts to make those with post thumbnail show up first
- Best way to check if a post with specific meta exists
- get_posts and wp_autop (remove filter)
- Trouble preventing duplicate posts between 2 loops on homepage
- Error in Wordprewss loop for page template [closed]