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?
- Display articles with a different template in the home page | Solved |
- Loop keeps showing the same post even when I click on a different one
- Adding $args to wp_schedule_event() causes hook to add infinitely to WP Cron
- Query users and count totals based on meta values
- How to add pagination in Terms
- wp_get_attachment_url not fetching URL?
- Duplicated tag in loop
- get the value for ALT is we check to see if an actual ALT value is set, if not we use the caption and if no caption is set we use the title
- Check if current post in loop is last on current page
- Filtering posts based on three taxonomies
- Insert content above an embedded video inside Wordress’ php the_content
- Creating a User-Adjustable chart in WordPress
- Undefined index: page in loop load ajax content
- WordPress next post by ajax call on button click
- WordPress Insert ads after every 5th post
- php loop error for count posts in category
- display post pdf attachments in side bar with link text
- How to display fields from the loop in two separate divs
- Loop only shows first two posts
- Why is my archive page looping through all but one post?
- Loop two different category WP_Query
- Adding a second loop breaks everything
- Use ACF Category Image for all Taxonomy Archive Views
- Solved – Inserting content inside the WordPress loop
- WordPress posts in the loop not stacking side by side
- WordPress posts loop not displaying all posts on blog
- Display all the terms within a custom taxonomy
- get_page_by_title not working inside fucntions.php
- A code that I could not fully grasp related to foreach & count_user_posts()