[resolved] Search Widget not working (3 posts)

  1. roiabrazaldo
    Posted 2 years ago #

    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.

  2. Toan Nguyen
    Posted 2 years ago #

    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.

  3. roiabrazaldo
    Posted 2 years ago #

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

    thanks man!

Topic Closed

This topic has been closed to new replies.

About this Topic