• toneburst

    (@toneburst)


    What’s the best way of implementing a search function for a specific category of a blog? I have a custom template for that particular category, and I’d like search results to be limited to that category, and appear in a layout like the custom layout for that category (rather than the standard search results template for the blog). Not sure how to approach it, to be honest.

    a|x

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter toneburst

    (@toneburst)

    Should I post this on one of the other forums, maybe?

    a|x

    huggie

    (@huggie)

    Hidden fields are a way of doing it.

    Samuel B

    (@samboll)

    Should I post this on one of the other forums, maybe?

    no – multiple posts on same topic not allowed – it would be deleted

    I really need help with this, I have set it up in many ways but the outcome is always the same, I get results from all of the categories. This is the code I have been using:

    <form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
    				<div class="search">
    					<input type="hidden" name="cat" value="3" />
    					<input type="text" name="s" id="s" class="input" onclick="this.value=''" value="<?php _e('Search Events...','cp'); ?>" onfocus="if (this.value == '<?php _e('Search Events...','cp'); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e('Search Events...','cp'); ?>';}" />
    					<input type="submit" class="go" value="Go!" />
    				</div>
    			</form>

    If anyone can point out my error that would be awesome, Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Search Function Within Custom Category Template’ is closed to new replies.