You need to simply pass your current page with your ajax request.
Put this property on your “body” tag to be able to get this with JS in the future.
<body page-id="<?php get_the_ID(); ?>">
Find it in your JS
var page_id = $('body').attr("page-id")
Pass it along with your other “data”:
var data = {
action : "my_ajax_filter_search",
project_type : project_type,
page_id: page_id
}
Related Posts:
- How to display an image before title text in menu items
- Filter works on last selection but no others
- Assign IDs to headings in ACF using functions.php
- ACF Filter return value
- Modify gform_other_choice_value for specific form and specific field in Gravity Forms
- Combine embed_oembed_html and oembed_result
- login_headertitle is deprecated since version 5.2.0
- Set “woocommerce_is_purchasable” to false for specific “$product->is_stock_status”
- Programmatically add Yoast meta description after post save
- Compare meta key to current date in pre get post
- How to display the_archive_title() and the_archive_description() – “weird” interaction
- Filter to wp_list_authors
- How to add custom li item to wordpress menu
- Native gallery custom html output
- The_content and Preg_replace in loaded Iframe [closed]
- How to edit/replace Parent functions.php function in Child Theme to add “Walker” class
- Functions Filter Question [closed]
- Is it possible to use add_filter in an included file in the child theme’s functions.php?
- Insert Content Before div#main from the functions.php File
- Add Adsense code between job listings – wp job manager plugin
- Problem with images URL after filter applying
- Using two loops in one WordPress template
- remove_action not working, even after changing priority [duplicate]
- remove/hide wp-editor
- Replace header image on all other pages but home – URL issue
- Insert a field with PREG_REPLACE – strange behaviour
- Add a class to post if it has been recently updated
- search form leads to 404
- how to add_filter to non hook function
- Perform function on publish AND save (not just save)
- Changing the text of Upload/Insert on Posts and Pages Screen
- Any adverse effects of adding apply_filters to a function?
- Conditional custom menu?
- Display ACF category image on archive and single template files
- Get URLs for AJAX Filter Checkboxes WordPress
- Featured Image and Tags problem
- Override a Post’s URL with Advanced Custom Fields Function
- how can I add filter in specfic field in my website?
- WordPress Function Assistance with Loop
- How to show ACF value under post/page title in wp-admin
- Adding custom social icons to the social media icon block in the Gutenberg editor?
- Customizing the wp_video_shortcode output with add_filter
- Overwrite text in a complicated filter hook
- How to add HTML into error message
- How to update an image attachment’s alt text from a custom field when saving a post?
- Save_post – Warning: Cannot modify header information
- custom error message for empty username and password using authenticate filter not working
- Removing comment lines from all enqueued js files using a filter function
- Add #primary at the end of navlink permalinks on single posts
- post value to function with Ajax and jQuery
- How Do I Unhook This Parent Theme Function?
- remove_filter function to unhook twentysixteen parent theme function
- Help with with my function for wordpress
- Allow user only create specific tags
- only update titles of single posts
- OOP Switch statement with array as parameter
- Child theme remove parent filter in functions
- How can I automatically delete comments that contain a URL?
- Appending „read more” to the excerpt conditionally
- How to add class dynamically from templates
- ACF Date Form in Custom Admin Field
- Prevent function from triggering on current page
- Reference multiple style sheets, clearing styles for permalink page, custom fields for css
- get_field() with ID in one signal filter not working
- function replace_text for entire page
- add product thumbnail to checkout page only and include variation name
- Redirect specific author posts to another url
- Echo a String Based On Geolocation? [Woocommerce || ACF]
- Comment function for page
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- Graphic before title – Specific Category
- Which method is more correct for removing WooCommerce Extensions menu item?
- $content is empty while using DOMDocument
- Hide disclaimer from summary excerpts
- Pagination not working on my archive page for a custom post type
- Only seems to be displaying one child when there are supposed to be multiple
- Return ACF Field value function
- Best way to add image to recent posts widget?
- How to make an If Else on Excerpt Filter
- Providing fallback function and allow override by plugin
- How to exclude posts with empty and non-existent relational custom field with meta_query?
- Why might wptexturize have become re-enabled?
- Shortcode to eliminate and replace with
- previous_post_link inside of a function?
- Search and Replace Script Loader in Head Only Works in Footer
- Regex works in regexr, but not if I filter content [closed]
- Different body image backgrounds on different pages, posts and categories
- Retrieve a custom form field modified by a filter
- functions.php filters not applied in AJAX call
- update_post_meta not working in function
- Problem in outputting shortcode
- List Most Read Posts from last 7 days (with custom post type and other meta queries)
- Settings in functions.php used by a plugin
- How to Add A Rel Filter to All Links?
- Print all inline styles to head
- Allow tags and attributes in post and pages content
- Override parent theme function that is not hooked or in the functions.php file
- Query Posts Via WordPress URL
- child_of not working while searching
- Can’t change excerpt length and more tag