Assign the value of you $_POST variable to a html element or javascript variable in front-page.php like
//html element
<input type="hidden" value="<?= $_POST['variable']?>" id="post-variable">
or in javascript variable
var postVariable = "<?= $_POST['variable']?>";
Now in ajax call, you can get the value as
var myValue = jQuery('#post-variable').val(); //if you set value to html element
or
var myValue = postVariable; //if you set the value in javascript variable.
Related Posts:
- ajax category filter
- How to get user_id from wordpress database inside ajax function?
- WP Pagination on Posts Search Results Page resulting from AJAX WP Query
- Error with function in functions.php?
- Loading two different AJAX requests on two different pages
- Getting the post terms ‘wp_get_post_terms’ per post when within the functions.php file
- WordPress dynamic AJAX query
- Add AJAX “Load more” on custom query block
- Custom query for custom post type not getting correct post ID
- Finding post ID dynamically on click
- Seach and categories not working when ignoring sticky posts in main loop
- Declare inline background image in functions.php
- I wan to process the following js to process the AJAX Request on my function to calculate author Total Post views
- Having trouble using this post category query on multiple pages?
- Adding css tweak based on page template
- WordPress pagination returns the same posts
- Wp get all the sub pages of the parent using wp query
- Query Posts in a Predefined Order
- wp_query->max_num_pages always returns 0 on custom post type
- Build a content and excerpt grid loop with paging and options for # of posts
- Get posts by meta data OR title
- Load more AJAX on WP Query
- Using is_main_query to select custom post type on certain page
- WP_Query ordered by custom field that is a date string?
- Function to check if author has posted within the last x days
- How to use filter hook posts_join for querying taxonomy terms in posts_where?
- How to pass custom parameter to WP_Query for filtering in pre_get_posts
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- How to Get All Posts but the Private ones?
- Single page theme that uses pages for the content
- Foreach-generated custom tax queries, each with an ajax “Load more” button
- How to query ‘posts_per_page’ to display a different blog posts index template?
- Get posts using WP_Query
- WP query exclude post within the last month / only show over 1 month old
- WordPress query for most recent posts from multiple categories
- Best practice custom function, where to echo the variables?
- Too many posts cause slow load when paginating
- How can I pick a single post from the latest 3?
- Query post with meta_query where date is not in future
- Query with custom taxonomy not working
- Query posts by specific word on title
- WP_Query last five posts, simply ordered by meta_value
- WP_Query “OR”: Find posts by ID, Name or Post Title?
- WP_Query condition affects posts_per_page count
- Custom Query num_rows returns wrong amount
- Using ajax with paging and a custom sub-query
- Category applied to pages, creates multiple breadcrumb entries after a search query (On the translated site)
- add active class based on permalink and url
- how to handle multiple ajax wordpress queries?
- Slow page loads due to WordPress Core Query
- Filtering out child category posts from parent category archive not working
- meta_query not working as expected
- Is there a better way to pull in custom content without querying posts?
- Reset WordPress Post Query to default
- Advanced WP Query and/or
- Pass $page_id to new WP_Query
- How to create custom query by keyword in post title?
- Create a page template for “top rated posts” but show full content and not just a list
- Change AJAX filter from POST to GET for URL Parameters
- Apply filters to main query instead of creating new one?
- WP_Query returns different results from get_posts() [closed]
- How to use a dropdown to filter posts by custom field
- How can I comment comma-separated array values?
- How do I fit WP_Query arguments into a function?
- Create a notification for post field
- Add URL Rewrite Rule To WordPress
- Creating attachments archive in tags and categories
- WP_query is not returning the expected result
- 2 queries with counters
- Multiple Query_Posts
- Posts limit on homepage (genesis framework)
- wpquery via ajax
- Page template doesn’t display simple HTML if inserted into other page?
- How do i create a custom post query when the meta value is an array?
- Duplice post with standard WP loop – fixed by using query_posts() instead
- Query for current post
- Custom query to retrieve oldest post and retrieve others with date interval
- Ajax buttons not working properly in WooCommerce when using wc_get_template_part
- Sorting query_posts() with a complex orderby filter
- Global page ID variable empty error
- How to show post title in content editor in backend?
- How to exclude posts by ID within a category/archive loop
- WP_Query & shortcode : Return 3 articles from a category WordPress
- Order & Orderby clause not working with custom query
- Save query in function for custom gallery
- Merge two queries and remove duplicate
- posts_per_page increment additional post
- Problem with custom WP_Query and underlying pagination/posts_per_page
- Pull posts from all categories if quantity is not met?
- What argument does my function need to echo get_results() query results
- Query_post 5 post first / last of post_id
- how to exclude store in clipper theme wordpress code php
- WP_Query for liked posts is showing all posts if none are liked
- Display post list within category list sorted by name [duplicate]
- Fire query on ajax post url page
- How to query post ids liked by the Author
- get contents and permalink from a specified page
- Help in query for list links
- WordPress WP_User_Query ignores the `meta_query` when called from an Ajax function
- Excluding a category from frontpage but not from WP_Query