Support » Themes and Templates » Search Problems with Red Train Theme

  • Resolved Alpione


    Please excuse my “newbiness.”

    I’m using the Red Train theme, which didn’t come with a custom “search.php” or “searchform.php,” so I’m using the ones that came with the Default theme (which may be my problem right there.)

    The search box on my main page seems to search properly, but the screen that displays the results is all messed up. It doesn’t seem to use the theme at all, and ends up being unusable. White on white, etc.

    Can someone clue me in on how to utilize the current theme in my search page?

    The site in question:



Viewing 5 replies - 1 through 5 (of 5 total)
  • You cannot just copy a template from one theme to another. You don’t really need to have a search.php (=template for displaying the search results) in your theme – if WP cannot find one, it will use your archive.php to list the posts found by the search.
    See Template Hierarchy in the Codex.
    Or, if you insist, then create your own search.php template by saving one of the files (probably the best bet would be the archive.php) from your theme and by comparing the code from other search.php files make it to work as you like.

    That makes sense. Red Train, unfortunately, didn’t come with an archive.php either, so apparently I’ll need to make one from scratch. Bummer…

    Thanks for the help…

    If you have neither archive.php or search.php, it will use index.php. If a page can find one which is listed in the template hierarchy, it will default to index.php.

    According to the Template Hierarchy if no archive.php then the index.php is used for displaying archive posts. Based on logic I’d say if no search.php >> archive.php >> index.php would be the route of the fallback.

    Ah ha… Removed the bunk search form and pointed it to my Index.php. Everything comes up fine now. Thanks to all!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Search Problems with Red Train Theme’ is closed to new replies.