60 posts High Quality Themes
  • Trendsetter
  • Weekly Top Seller
  • Elite Author
  • Author Level 8
+4 more
HighThemes
says

Hi mates. I simply want to include a custom field in search results.

for example the search term is “lorem ipsum”. Wordpress by default just compares it with title & content. I want it to compare it with a custom field as well.

I googled a lot but no result!

Thanks

1149 posts
  • Affiliate Level 1
  • Author Level 3
  • Beta Tester
  • Collector Level 2
+3 more
fillerspace
says

WordPress search is just passing parameters to WP_query (http://codex.wordpress.org/Function_Reference/WP_Query). You can pass additional parameters and construct your own WP_query. For custom posts, I believe meta_value= should do the trick.

$search_query = new WP_Query('meta_value='.$search);
2468 posts
  • 6 Years of Membership
  • Author Level 2
  • Affiliate Level 4
  • Beta Tester
+3 more
digitalimpact
says

This should get you on the right track : http://sixrevisions.com/wordpress/custom-fields-search/

60 posts High Quality Themes
  • Trendsetter
  • Weekly Top Seller
  • Elite Author
  • Author Level 8
+4 more
HighThemes
says
by
by
by
by
by
by