Soo I just made a simple search page. Its working! But i wanted to filter the results. The query that i wanted to make its like, it will search by the name of the articles and filter it, soo it only appears the articles from the category X (By ID).
This is my form:
<form action="<?php get_bloginfo('url') ?>" id="searchform" method="get">
<div>
<input type="text" value="" name="search" id="search" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>
This is my query:
query_posts( array(
's' => $_REQUEST[ 'search' ],
'category' => '',
'paged' => $paged
)
);
EDIT: Im kinda stuck on the category part. I know it doesnt work if it stays there empty.
Attempt 1
Tried to equal the category id and use it as a query
query_posts( array(
's' => $_REQUEST[ 'search' ],
the_category_ID() => '42',
'paged' => $paged
)
);