I am using the Directory Theme and I have followed the video tutorial on Search Setup, but my new search queries are not saving. When I save them, instead of keeping them, the page just resets to the default of Keyword search.
Amy, did you set up a fresh install without sample data and is the Keyword element the only one on the page? If so I had a similar problem – let me know and I’ll let you know how I fixed it.
Yes, that is correct. A fresh install with no sample data.
Ok, here’s what to do:
1. Make a copy of you functions.php file and add this code to the end of it but above the closing ?>.
$wpdb->query(“CREATE TABLE IF NOT EXISTS".$wpdb->prefix."core_search ( id int(11) NOT NULL AUTO_INCREMENT, label varchar(50) NULL, description varchar(100) NULL, type varchar(10) NULL, operator varchar(10) NULL, compare varchar(10) NULL, values text NULL, key varchar(20) NULL, alias varchar(20) NULL, field_type varchar(15) NULL, order smallint(2) NULL, link varchar(100), PRIMARY KEY (id) )”);
2. Rename the functions.php file in the wp-content/thmes/DT folder on your server to a say SAVEfunctions.php and upload the modified version.
3. Go to Search Setup and make one mod – even just change the label on the Keyword element and Save. It should work this time.
4. Now you can delete the modified functions.php file from server and rename your old one back in.
It should all be fine now, you just need that modified functions file to do the first save.
If you aren’t technical enough to do this then raise a ticket and just state the problem and what I’ve said and Mark will recognise the problem as he gave me this info. They will do it for you.
I think I can do this. If not, I’ll start a ticket. Thanks much!
No problem Amy. If you have any problems I can post the file for you here.
Thanks for sharing Janak 🙂
So, I see that this is out of date, but its still an issue that I’m having. I tried updating the functions.php file but had trouble with it. Since this is out of date, what is the new solution?
Amy, the solution is still the same.
I read on another thread it may be fixed in the next release but until it is this the way to fix it.
Hello Amy, Please open a ticket if still having the issue >>https://s.premiumpress.com/index.php?/Tickets/Submit
I tried by going to Theme Setup->Toolbox->Database Tables->Re-install Missing Tables.
And then I went to search page and I tried adding taxanomy and it got saved.
Note: Take necessary backups before you do this.
Thanks for sharing 🙂
Which is the best method to fixing this issue?
Hello Dinesh, Best option is to reinstall missing tables. Theme Setup >Toolbox >Database Tables >Re-install Missing Tables.
Start your new website today!