0

I've got a site on Wordpress 4.0.1, and I can't find search.php.

A database batch process has applied a template to the default search results page, but I now can't find the page to change it back.

How can I change the template of this page?

Would creating a new "search.php" in my theme help? If so, what should this file contain?

1
  • yes it probably would, having search.php is not mandatory for a theme, if it is not present it will fall back to index.php
    – Wyck
    Jan 26, 2015 at 23:06

2 Answers 2

0

Normally, copying index.php file for the theme as search.php will let you have a new base template to work off of with the same styles and look as your theme, assuming the theme implemented index.php decently.

That would give you a solid start to be able to make changes to provided nothing is using a hook such as template_redirect to hijack the search results and use some other template to display them.

0

Privateer was on the right track, however, copying index.php as search.php didn't change the results.

My solution was to find a known good copy of search.php and use that instead. https://wordpress.org/support/topic/plugin-wp-paginate-cant-install-on was the copy. I've modified it for my purposes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.