WordPress.org

Ready to get started?Download WordPress

Forums

1.3 wp-header/wp-footer/alternate templates (4 posts)

  1. ringmaster
    Member
    Posted 9 years ago #

    Can someone please explain the point/use of the wp-header.php and wp-footer.php files in the new 1.3 template?
    For insteance, how would one go about writing a special result page that is displayed when a user performs a search, ala wp-content/search.php?
    Is this functionality more useful than it is confusing?

  2. ringmaster
    Member
    Posted 9 years ago #

    But if the point of my having a separate search page is to provide the same old search results with a different menu on the sidebar than what would normally appear, this does nothing for me, right?
    Actually, it would seem to make things more difficult, since I wouldn't have to create a search.php file, but I'd have to put all my own conditionals to detect a search page (ok, just one, but still) into footer.php.

  3. ringmaster
    Member
    Posted 9 years ago #

    Er. Wait a minute. The header and footer aren't included when an alternate page is used. So to do what I've described above, I would have to create a search.php page, and it would have to have footer-like code in it to display a sidebar. Correct?
    I guess if I want my sidebars on all my pages to look the same, this works with an include, which is pretty simple.
    Clearly, this "advanced" feature needs documentation.

  4. Beel
    Member
    Posted 9 years ago #

    The point is the separate search page can do anything you want it to do, it is not limited to the built in search function of WP.
    Your are right it would be more difficult if you are just trying to recreate what WP already does.
    During the past 10 minutes I have been playing around with search.php on my site and I have it offer a google search if nothing is found, show only the excerpt, etc. No tweaking of the base files in WP - If I screw up search.php, I just delete it and I am back to square one.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.