I've nearly finished a blog that I'm working on but the search feature isn't working quite correctly. Searches that should return more than one result only return one.

I guess I'm not really sure where to look to solve this issue as I'm not very experienced with Wordpress. The site is WP version 3.3.1 and uses search.php The template is a modified version of Wordfinder.

Any tips or suggestions would be greatly appreciated.

  • can you link to online blog? – Sagive SEO Jan 23 '12 at 21:06
  • If you run global $wp_query; var_dump( $wp_query ); what do you get? This may reveal some messed up query vars. – tollmanz Jan 24 '12 at 4:40
  • I ran the query that you suggested. I searched for a term that should be fairly prevalent in my blog and it returned a bunch of posts that contain that word. So it seems like it's working the in the sense that it's finding the correct posts—it's just not displaying all of them when – Vecta Jan 24 '12 at 17:57
  • 1
    Did you ever get this resolved? If so, it would be great to post your solution here for others. If not, I'm guessing that something else (a plugin or part of your theme) is intersecting the loop and cutting it short. The only thing odd that I could spot in your search.php file is wpe_excerpt. Also, just for giggles, have you viewed source and verified that your page is finishing (i.e. closing body and html tags)? If not, it could be a PHP fatal error. – Matthew Boynes Feb 7 '12 at 23:18
  • 1
    Sorry! I did figure it out and just forgot to come back here. That was exactly it. I removed the wpe_excerpt bit and it worked once again. – Vecta Feb 8 '12 at 19:27

Here, wpe_excerpt is not defined so the page is erroring out.

| improve this answer | |

Add an wp_reset_query() befor and after Loop, maybe it works. Works not, debug the query and see, what are in the array, all results or only one entry.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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