• I want to use my search page for categories and tags when users select either.

    The only mod I need to do to the search.php is to know whether it was the result of a search, a tag or a category and I will have some code saying

    You searched for : xxxx
    or
    Your matches for tag: zzzz
    or
    Your matches for category : yyyyy

    How do I get category.php and tag.php to call search.php and how do I pass a variable that search.php will be able to identify ?

    Any pointers or solutions will be much appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mcl

    (@mcl)

    Eventually worked it out. There maybe a better solution.

    In search.php, tag.php and category.php

    have <?php get_header(); ?>
    print out comments about search or tag or category
    then include a separate file with the result formatting and the sidebar and footer calls

    The reason for this is to allow any changes in the results layout, to be made in one place only (I only list titles and metadata)

    Thread Starter mcl

    (@mcl)

    Forgot to code the important line

    <?php include( TEMPLATEPATH . '/header2.php' ); ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search Page doubling as a category and tag page’ is closed to new replies.