I need to add a functioning search bar to my header. I have read through the forums but am unsure what code I need to put where. For instance, where do I put the css code versus where do I put the html code. Any direction would be much appreciated.

  • What theme are you using? Commented Aug 6, 2015 at 16:08

1 Answer 1


Just add to your theme this code:

<?php get_search_form(); ?>

This code will echoing search form so place it everywhere where you want to have the search form.

Further you need to have search.php file in your theme which will show the search results. You can use ordinary WP loop in the file.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.