On your search form you use NULL (as a string) for Any selection.
When the form is submitted it is sent as a string with the contents of the word null.
Your isset then sees that, its set and sets the session to null (as a string). Which in turn messes up your query.
To fix use:
<option value="">Any</option>
and check with:
!empty()
Related Posts:
- filter search result with custom post type meta key
- How Do I Use WP_Query to Run This Database Query as Search Result?
- Building an Advanced Search (text, tags, category, custom fields) – Getting the wrong SQL query
- Custom search for custom post meta with pre_get_posts interferes with WP search
- Multiple meta_values in the pre_get_posts filter?
- Prevent A Specific Custom Post Type Showing In WP Search Results Page
- Custom Post Search
- pre_get_posts not firing at all
- Search for portfolio tags & mixing portfoliotags and post tags
- Searching Custom Fields
- Advanced search form with filters for custom taxonomies
- dropdowboxes with pre-selected custom fields optios that filters the results according seach needs
- filter search custom field query
- Different results between permalink and query var search
- How to let users choose where to search for posts?
- WordPress Custom Search by post_type
- Include custom taxonomy term in search
- What content types are shown at a search page?
- Can NOT search my custom post type?
- Search one custom post type ONLY, disable “all posts”
- Custom post_type search pages
- Query multiple taxonomies with pre get posts
- Main menu not appearing in custom post type archive
- Pagination Error : Duplicate argument being outputted
- WordPress search and date filter not working with custom post type
- Custom Empty Results page for my Custom Post Type
- Excluding a Custom Post Type with a specific tag using pre_get_posts
- Custom filter for main search: how to exclude specific post_type from search results
- Add custom attributes to a post
- Display an icon based on post type
- how to show records that don’t have custom meta value
- how to get this tax_query working?
- Select2 AJAX and WP Query Returns ALL and does not filter
- Custom Taxonomy Search result page
- CPT is simply not displayed in the main archive with “pre_get_posts”
- How to group search results by post type and only if post type result is not empty?
- find custom post type post by searching its custom field with my string
- search custom post type by custom fields on front end
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- Custom Search | check multiple meta_value for search value
- Hide custom post type from search based on custom taxonomy
- How to query for posts (hierarchical custom post type) that have children but are NOT top level?
- What is the correct term for a tool that filters content based on metadata?
- CPT Archive pre_get_posts not working?
- Pagination on search results page
- Ideas on how to organize a project [closed]
- Best way to create a search for custom post type by custom field values
- Filtering custom posts by custom fields (ACF) [closed]
- Searching post types
- Blank search results on custom search
- Multi Parameter search with custom post type category and tag
- CPT, meta-data, url parameter
- Limit search field to just search a custom post type with custom fields
- Search CPT Title AND Meta
- pre_get_posts works in post type archive but not in single post
- Building a Data Intensive Website with WordPress
- Display future posts in search
- Redirecting search to specific templates with $_GET[“post_type”]
- Modifying search results based on post_type
- Search custom type post
- How to Implement Search Functionality?
- How to have multiple search result pages in wordpress with taxonomy terms listed
- How to use pre_get_posts on archive page custom post type
- WordPress CPT Taxonomy Dashboard Search – How to include taxonomy in search?
- Is it possible to get the specific content on the search page?
- Order posts by taxonomy terms
- Change search query in wordpress custom post type
- Search for custom field input of a custom post type in ajax live search
- Query to Exclude Child Pages from Custom Post Type Archive
- Create a post automatically if search result has zero results
- How do I troubleshoot pre_get_posts with Debug Bar?
- Creating a custom WP query for a Custom Post Type
- In the php, how can I have a category of a custom post type display?
- Search Function not searching correct custom_post_type even though post_type is defined in search args
- Search only one custom post type
- How to hide private posts even if user is admin
- WP_List_Table Inside Metabox Not Working on Clicking Search Button
- Query first and last name from custom post type
- Custom Post type doesn’t appear in search results
- search results to show individual ACF fields from inside custom posts
- Display Specific Posts at Start of Loop
- post_type incorrect for custom post type
- Live search by custom tag
- List all posts associated under custom taxonomy
- Custom search for a custom post type in WordPress
- how to create custom taxonomy drop downs for parents and child
- Advanced search form with multiple custom fields
- Custom Archive – hide posts until a search is made?
- $_SESSION Not working after X amount of page views
- Search in multiple specific post types
- Set different posts_per_page for custom post type/taxonomy
- I can not display search template created from a post type custom
- Creating a search results page from a custom post type in a plugin?
- CPT year wise archive based on custom date Field
- Apply pre_get_posts to specific custom post type in the admin area
- Search custom post type result in same template page
- pre_get_posts gives 404 error on Custom Post
- Display result as “prefix+ID” and show in the search result as bookcode
- Include images from pages in wp search.php results in default wp search
- Search facility with directories