Support » Fixing WordPress » Search Widget not working

  • Resolved roiabrazaldo


    Ok, I sweep alot of other topics and documentation and it doesn’t help in anyway so I’m posting my problem. Please help.

    I’m making my own theme (from a scratch) reading documentations and tutorial I manage to make my theme working and its great and rewarding but as I dig deep for more features I came along with the default search widget given by wordpress. I manage to add it in my sidebar but when I search for something it throw me back to home page.

    It threw me back to home page because I didn’t add a search.php page,
    so I added one, and now it throw me there.

    my problem is what should I put on that search.php to query the result of the search widget. I tried to follow this but it doesn’t work.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Simply, you need to create a php file in theme folder, its search.php, then write a loop condition as below:

    if(have_posts()):while (have_posts()):the_post();
    	### for the title
    	### for the content

    You can markup as your style in html, it will work.

    damn, why your code work, been there and done that mine didn’t work.

    thanks man!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search Widget not working’ is closed to new replies.