60 posts High Quality Themes
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 4-5 years
  • Referred between 50 and 99 users
  • Bought between 10 and 49 items
  • Exclusive Author
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

1148 posts
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • Has been a member for 4-5 years
  • Bought between 10 and 49 items
  • Exclusive Author
  • Envato Studio (Microlancer) Beta Tester
  • United States
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);
2441 posts
  • Has been a member for 5-6 years
  • Exclusive Author
  • Europe
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Sold between 100 and 1 000 dollars
  • Envato Studio (Microlancer) Beta Tester
digitalimpact says

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

60 posts High Quality Themes
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 4-5 years
  • Referred between 50 and 99 users
  • Bought between 10 and 49 items
  • Exclusive Author
HighThemes says
by
by
by
by
by
by