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
- new WP_Query(), have_posts() return false in user_register hook
- Load More Posts Button – AJAX
- How to filter, restrict and return posts based on custom user meta information
- add active class based on permalink and url
- Bypass “supress_filters” in WP Query
- how to handle multiple ajax wordpress queries?
- WP Query using tax_query & meta_query
- Slow page loads due to WordPress Core Query
- Ajax WP_Query reutrns no results on author.php
- how to make members list directory through wordpress post custom meta key.
- wordpress search word, “hello world” ===> ‘hello+world’ ===> ‘hello’, ‘world’
- add_filter(‘query_vars’) not working in custom template
- Add class to first post in custom loop using post_class filter
- Filtering out child category posts from parent category archive not working
- Display most popular in the past two days
- Some doubts about how the main query and the custom query works in this custom theme?
- How to display an other custom post type in a different custom post type’s archive?
- Random ajax load only works with posts_per_page set to -1
- meta_query not working as expected
- Display custom tags on pages that have a specific page parent
- New WP_Query calls Pre_get_posts filter twice
- How to exclude post formats from wordpress recent posts in a tabs widget [closed]
- Current post in AJAX call is always zero
- How to increase load time of an archive/search page (WP_Query)
- Query Page Content From Theme Options?
- Filter wordpress post categories with jquery/ajax and pagination?
- Query all posts if multiple meta key don’t exist
- how to access query string in wordpress?
- Is there a better way to pull in custom content without querying posts?
- How to query for all posts that have a particular meta key?
- Reset WordPress Post Query to default
- Advanced WP Query and/or
- How to get all post except particular category without breaking the paging
- How do I rewrite this loop as a new WP_Query style-loop?
- Pass $page_id to new WP_Query
- Exclude All Posts Which Do Not Have A Tag Assigned
- How can I override one post and make it display content for another post?
- Ajax future single post query doesn’t work when NOT logged in
- Include current post into loop
- how update data through ajax and jquery
- Merge two search functions for custom post type
- Filter Custom Taxonomy Posts
- Get all posts which was posted on X Days WordPress
- Make a SQL query with wpdb in WordPress
- How to provide meta_key array to wp_query?
- how to use pre_gets_posts to exclude one queried ID from homepage loop
- Easy way to write complex queries in wordpress
- Filter post query to only show direct children of category
- Order post type by sum of two custom fields
- get_posts output always same post
- Query_posts works when appending via AJAX call wp_query doesn’t?
- Use WP_Query or query_posts() or get_posts() for optimizing a site?
- Use Ajax To filter posts?
- How to create custom query by keyword in post title?
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- Conditional operator OR not working with custom fields
- complex get_posts() query to select child pages
- Pagination on template page for custom query redirecting to index.php
- Get posts that do not have the same tags as current
- How to check in functions.php if there is data in a WP_Query?
- 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
- Should I reset $wp_query?
- Exclude authors IDs from WP_Query
- AJAX Breaking Offset Argument In WP Query
- Apply filters to main query instead of creating new one?
- Posts Query | Query to only show sub categories
- WP_Query returns different results from get_posts() [closed]
- wp_query with ajax
- How to load a script code only in posts?
- change the default order of posts only for specific categories
- inserting content of 1 Post to in another with a template hierarchy
- Post not populating for custom post type based on category selection
- Multiple meta_key ordering with pre_get_posts
- WP_Query offset is returning post from prevois loop
- Posts query according to meta box date
- How to use a dropdown to filter posts by custom field
- How can I comment comma-separated array values?
- How do I add a relation parameter to my filter query?
- How do I fit WP_Query arguments into a function?
- Create a notification for post field
- Does WP_Query ‘responds’ badly to empty arguments?
- Retrieve data from wordpress db via input and put those result in dropdown
- How to generate feed for custom template