Advanced search not working for CPT
This topic contains 16 replies, has 3 voices, and was last updated by Stiofan O’Connor 8 years, 3 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
July 12, 2017 at 12:27 pm #386716
I’ve set-up a CPT and have three advanced search fields set-up, but one of them isn’t working.
The two that are working are ‘search by distance’ and ‘search by category’, but the third is a series of checkboxes and if I select 1 of the checkboxes that I know exists in the CPT, the search results still show all results, even though only one of them (the one with the checkbox selected) should actually appear.
July 12, 2017 at 5:51 pm #386763Hi,
normally that happens when another plugin is interfering with GD search queries.
Please provide a link and admin credentials in a private reply and we will look into it.
Thanks
July 12, 2017 at 9:07 pm #386797This reply has been marked as private.July 13, 2017 at 4:33 pm #386916Hi Louise,
I don’t see any of the plugin that are known to cause issues to the search form.
I asked to the developers to have a look and let us know,
Thanks
July 13, 2017 at 6:10 pm #386935Thanks. We can confirm that too, as we just deactivated all plugins except the GeoDirectory ones and the advanced search still doesn’t work.
We’re aiming to launch our new website tomorrow, so we’re really keen to have this issue resolved asap.
July 13, 2017 at 6:23 pm #386939I don’t see any problems off hand, can you provide FTP info and i’ll debug this.
Thanks,
Stiofan
July 13, 2017 at 6:48 pm #386949This reply has been marked as private.July 13, 2017 at 6:54 pm #386952This reply has been marked as private.July 13, 2017 at 7:02 pm #386960It’s something to do with your theme, i am checking now, 5 minz…
Stiofan
July 13, 2017 at 7:20 pm #386963I have added the below code snippet to fix the search with your theme
add_action( 'after_setup_theme', '_my_fix_gd_search' ); function _my_fix_gd_search(){ if(isset($_REQUEST['geodir_search'])){ remove_filter('pre_get_posts', 'magup_searchfilter'); } }Thanks and good luck with your launch tomorrow 🙂
Stiofan
July 13, 2017 at 9:07 pm #386976Thanks Stiofan! Everything is working!
July 14, 2017 at 2:53 pm #387056We’ve just migrated the site ready for launch and we’ve got a problem with the Geo Directory! None of the CPTs (including the original ‘places’) have come across to the new server.
The migration process was done by taking a backup of the database via phpmyadmin, find and replace on the database file for new domain, then import to new server.
The whole site is working fine except for the Geo Directory CPTs!!
We’re desperate to go live today, so please could you help asap?
July 14, 2017 at 2:56 pm #387057How did you do search and replace on the database?
If you didn’t use something like better search and replace plugin, you broke serialized options.
Let us know,
July 14, 2017 at 2:58 pm #387058We opened the sql file in text edit (plain text) on a Mac and ran the find and replace from there.
July 14, 2017 at 3:02 pm #387059Yeah “that’s your problem” 🙂
You have serialized data which is length specific..Do it again but only replace two items in the DB file
1. site_url
2. home
These will likely be the first couple of options in the wp_options table.Then u will be able to get in to the site, donwload the plugin “Better search replace” then use that to search for the old url and repalce with the new url, then save your permalinks options to clear any permalink cache and you should be good to go.
Let us know if u have any probelms.
Thanks,
Stiofan
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket