Forums

[resolved] How to modify seacrh.php for custom theme (7 posts)

  1. ptaxi
    Member
    Posted 1 year ago #

    I am trying to modify a search.php (from Twentyten theme)page for my custom theme.

    So far, when I run a search, all that displays is header saying "Search Results For:xx". But there are no actual search results.

    Can someone be more specific with regards to what changes I have to make to the search.php file in order to customize for my theme?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Start again using the search.php template file from TwentyTen "as is". Ensure that you have a loop.php or loop-search.php file in your theme.

  3. ptaxi
    Member
    Posted 1 year ago #

    Still no go..

    Could the problem be something to do with the fact that my search button (and form) in in my header.php, and I have NO sidebar.php?

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    No - that shouldn't matter. It sounds like you're missing the Loop. What version of WordPress are you using?

  5. ptaxi
    Member
    Posted 1 year ago #

    I apologize. I did not read you previous post carefully- I did not have a loop.php file in my theme.

    Now after copying this file from Twentyten to my theme, the search works better, but still displays this error:

    Fatal error: Call to undefined function twentyten_posted_on() in C:\xampplite\htdocs\wordpress\wp-content\themes\wp2\loop.php on line 129

    When I check in the file, and delete the div at line 129 (which is as follows), it seems to work OK.

    <div class="entry-meta">
    <?php twentyten_posted_on(); ?>
    </div><!-- .entry-meta -->

    Can you tell me what this div does exactly?

  6. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    It outputs the post's date, author etc.

  7. ptaxi
    Member
    Posted 1 year ago #

    Thank you for your help... For now I will exclude:

    <div class="entry-meta">
    <?php twentyten_posted_on(); ?>
    </div><!-- .entry-meta -->

    from my theme...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags