Check out WP::parse_request()
– unfortunately, it was never really designed for public use. You could try this, not sure of the repercussions:
global $wp,
$wp_the_query;
// Grab the request_uri component of the referer URL.
if ( ! $url = parse_url( $_GET['my_referer_parameter'] ) )
return 'Oh dear, poorly formed referer.';
// Ewww! Trick WP::parse_request by spoofing REQUEST_URI.
$_SERVER['REQUEST_URI'] = $url['path'] . "?{$url['query']}";
$wp->parse_request();
$wp->query_posts();
// $wp_the_query should now be populated with posts queried by your referer.
while ( $wp_the_query->have_posts() ) {
$wp_the_query->the_post();
the_title();
}
Related Posts:
- paged > max_num_pages won’t throw 404
- How can I use the WordPress Loop and Pagination in multiple instances but different scenarios throughout my site?
- Retrieve WordPress’ the_content() with jQuery
- Pagination and multiple loops
- Pagination don’t work with active filters
- WordPress Insert ads after every 5th post
- White screen of death on index.php page 3 and above?
- my ajax wont sent the data, please correct my code
- control posts order by select option
- Does the functions.php file ever get called during an AJAX call? Debug AJAX
- Get ‘page’ number with infinite scroll
- How bad is it if I write AJAX functions using wp-load.php?
- Get 10 posts from a WP_Query. If less than 10, get the remainder from elsewhere
- Why doesn’t /2013/01/ properly return January’s archives in archive.php?
- Strategy to get post meta for use outside the loop
- redirect does not work in ajax function
- Grab the first paragraph of each post
- Add a preview to a WordPress Control Panel
- Single Page WordPress Theme – Using page templates
- A two column loop with one lead post
- Changing the entire control choices using wp.customize with JavaScript
- Pagination & get_pages?
- Change loop order via form or link (jquery, not URL)
- First post of each category
- Is there any need to use both wp_reset_postdata and wp_reset_query together?
- query posts in wordpress
- Getting Permalink within the loop
- the_content() in single-{post-type}.php problem
- Why does this loop only work on the homepage?
- Setting hero/splash section as a blog post
- posts_nav_link(); not showing up on static pages
- How to retrieve an image from a post and display it before excerpt of a post? [duplicate]
- Paging on a future post loop?
- Can’t access WordPress functions in file called via Ajax?
- Any tag pagination page (except the 1st page) loads index.php template instead of tag.php
- Finding Page Template and Displaying Content
- Adding default pagination to wordpress loop
- Why is the first query affecting the second query, even after wp_reset_query() and wp_reset_postdata(), but not on the second page?
- Link won’t show using the_permalink();
- Some doubts about how to show posts in a custom theme?
- Force index.php have_posts() loop to exit if no sticky posts found
- How to Globally Use wp_localize_script() Ajax URL
- trying to use wp_handle_upload with ajax
- WordPress with broken paging page 3
- Using AJAX in wordpress theme
- show a post from a specific post format
- Displaying recent post excerpts on static front page
- Conditional statement to show pagination
- Using an if statement in the theme customizer page
- Limit Loop to 5 Posts?
- How to show user online status on their posts?
- Custom get_the_excerpt() only works on first post
- Retrieve localised value
- AJAXIFY WordPress Theme Frontend menu
- Echo all category names, apart from one
- Post thumbnail to append post content via ajax click event
- Would to use AJAX to get an option from the database and use it in a jquery setup or is there an alternative to consider?
- how to get the post attachement image in full size?
- Get the amount of posts on a given page
- How to list articles by year based on url?
- Change image size depending on page
- pagination for a custom loop with multiple post types
- How can I prevent posts with no title showing up in my query?
- ajax response -1 in wordpress theme
- What template file is used for homepage pagination?
- Previous and Next links not populating, have I missed something?
- Why does admin-ajax load slow and what are ways to speed it up?
- Why WordPress AJAX returns undefined however it works fine when I add static url instead of dynamic function?
- How to use ajax in wordpress and sending the data without refreshing ?
- Issue on Accessing To Ajax Enqeued File to Pass to URL for Ajax Call
- pass wordpress template directory into ajax url call
- Twenty Seventeen Pages Loop
- How does the loop know which post to view?
- Ajax call returns 0 when add_action is inside a class in functions.php
- Pagination fuction in shortcode always displays on top
- Pagination not working on custom post page
- Exclude subcategory from wp_query
- Style first 3 posts differently with WP_Query [duplicate]
- WP_Query not getting all posts, just tagged posts
- first excerpt fine, subsequent post excerpts shift to the right instead of displaying vertically [closed]
- AJAX call fails when sending JSON but works with URL style string
- How can I sort my loop based on meta data, using a form?
- List categories of a post hierarchically?
- Exclude parent categories from the_category() within the loop
- How to know if I am on 1st page
- get_the_terms() returning wrong results inside of loop
- Woocommerce Variable Product Dropdown for Custom Shop Template
- Woocommerce AJAX filters option loading spiner – problem on mobile device
- Show the number of the post
- Show only pages you are author of
- how use ajax to custom page template
- Add class every 4 post like , class_1, class_2, class_3, class_4 and class_1, class_2, class_3, class_4
- How to properly use AWS SES for a contact form?
- How do I make my terms for each product display via foreach loop? (woocommerce)
- Why excerpt hook not working inside ajax function?
- WordPress theme files Organization
- Theme functions don’t work as expected in partial included via get_template_part() after custom query using Ajax [duplicate]
- How to implement pagination in category.php template
- Infinite loop when nesting have_posts()
- How to load jQuery with Ajax in WP version 5.3.2?