• I want to add a searchform in all my categories to search only the post on the current category.

    <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
    <div><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
    <input type="hidden" name="cat" value="22" />
    <input type="submit" id="searchsubmit" value="Search" />
    </div>
    </form>

    How to modify this value to be for the current category page without need to make a template for every category?
    <input type="hidden" name="cat" value="22" />

    THNX ??

Viewing 1 replies (of 1 total)
  • Thread Starter rey1986

    (@rey1986)

    I did it

    was needed this

    <input type="hidden" name="cat" value="<? $cat ?>"

    An onne last thing to change the appearance of search button

    like “Search on currentcategoryname”

    <input type="submit" id="searchsubmit" value="Search on categoryname" />

    thnx

Viewing 1 replies (of 1 total)
  • The topic ‘Adding a search form on every category page?’ is closed to new replies.