WordPress Search Theme Tutorial

WordPress Search Theme Tutorial

In this lesson we learn how to add a search form to our theme’s header, and also how to control the output for the relevant search results screen. Check out my “Get a Developer Job” course:

To view a complete list of the WordPress lessons in sequential order visit:

Link to download .zip of theme files as shown in this video (note: this is not a “complete” WordPress theme yet and this download is only intended for educational purposes to dissect and review):

Want to share the WordPress website that you’ve been creating on your computer with the world? Learn about the web host I use and how you can get a domain + hosting for .95 a month ( savings):

Sign up for my newsletter to receive periodic webDev tips, tricks, resources and coupons. Join the list at

Follow LearnWebCode on Twitter for resources and updates:


35 Replies to “WordPress Search Theme Tutorial”

  1. Great tutorial! You have learnt me a lot! Thank you!
    I have a question. In HTML5 specification it is said to use “article”, “section” etc instead of the “div” element. Isnt it wrong to use only “div” elements?

  2. Hi you are doing some great work! Can you please give some pointers on this. I have a database with certain information, I need to run certain querys based on user input and display the data. I tried to do it in the traditional way, by doing but when I load get_header() in formprocess.php it gives me a fatal error.

  3. I think, You are the Master of not only Web Development but also web Designing. Thanks lot.

  4. Can someone answer my question. So basically he’s teaching us how to make your theme for WordPress?

  5. Could you please show us how to, when no results are available, show “No results found. Search again? [__search box__] ?

    Thanks for the tutorials (again). I have watched these dozens of times over the past half year of learning code.

  6. Maybe somebody can answer this – is there any reason why you use div.hd-search to target the search bar, instead of just .hd-search?

  7. This is amazing, you have great ability to teach complicated things became simple. Love your tutorial.

  8. tutorial is very best
    anything i write 100% same to you but it shows error php error

  9. Help me out here ,when i search any post whole layout just messed up floated to right ,
    and Nice work man !

  10. You are awesome man,I have learned wordpress theme functionality from this valuable tutorial,awesome man………………………

  11. Hi great video, just wondering how to improve the search function of wordpress, since it just evaluates titles and content in posts, i want to add it categories, author, dates.

  12. I am not able to search by category or tag name. I have assigned the post to categories in the admin panel. Is their any thing else I need to do to enable category or tag search from search input box?

  13. nice tutorial sir, one question. how to create a pagination for search result page?

  14. You are the perfect ,, How easily i could learn… Thank you soo much .. i expect further more useful tutorial of wordpress.

  15. one question though : for the div.hd-search label , why tou did not want to use the display:none; ? it would have affected the accesibility ?

  16. Question, at 0:55 seconds roughly you’re doing something to create a open div, comment, and close div with comment at the same time. How ?

  17. Hello LearnWebCode!
    Your tutorials are very helpful for me and
    I very appreciate.
    I have one question about my stylesheet doesn’t work with the correct code .
    Can you show me why and how to fix it.
    Thank you very much.

  18. Hi There, i am facing one issue regarding CSS, it’s seem it is not communicating with anything i have to wait at least 10 hours to see the actual change, can u suggest some please?

  19. and can you make a video for make own Widget for featured posts or for any part we can add as in mind ? will wait for your reply thanks.

  20. thanks for everything but seriously dude hiding an element with left: -9999px? how about display: none? don’t show people things that could mess them up… Great course by the way 🙂

  21. oh fuck… this guy is a coder and developer… i copied a bunch of videos only to find out that this stuff is way over my head 🙂 well, back to the drawing board.

  22. Thank you again for the useful videos! I am following your WordPress lessons, although I am a SAP consultant and new to web development they are very clear and easy to understand. Keep up the good work.

  23. Well, when I search for a category that I have on a post I get no results. I have tried with different categories but without any luck.

  24. @LearnWebCode 3:30 Why can’t we simply make label element to Display : none and add aria-* attribute for accessibility reasons ..???

Comments are closed.