Thread Starter
dadvan
(@dadvan)
I am able to search within the tag group with this:
<form method="get" id="search form" action="/">
<div>
<input type="text" value="" name="s" id="s" />
<input type="hidden" value="consulting" name="tag" id="post_tag" />
<input type="submit" id="search_submit" name="Search" value="Search"/>
</div>
</form>
How can I pull in the page slug as the value in the hidden field?
Thread Starter
dadvan
(@dadvan)
OK, So i inputted this in the value and now it will search in a tag that matches the page slug:
<?php echo $post->post_name; ?>
Hope this helps someone!
Hiya,
I’m also trying to create a search form that finds and highlights the results by only looking at the current page.
thanks!