7

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.

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

1 Answer 1

10

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.

0

Your Answer

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

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