WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Search Problems with Red Train Theme (6 posts)

  1. Alpione
    Member
    Posted 9 years ago #

    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: http://www.alpione.com

    Thanks!

    Adam

  2. moshu
    Member
    Posted 9 years ago #

    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.
    HTH

  3. Alpione
    Member
    Posted 9 years ago #

    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...

  4. iand
    Member
    Posted 9 years ago #

    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.

  5. moshu
    Member
    Posted 9 years ago #

    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.

  6. Alpione
    Member
    Posted 9 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags