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
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);This should get you on the right track : http://sixrevisions.com/wordpress/custom-fields-search/
thanks found a solution here: http://www.braindonor.net/coding-blog/wordpress-custom-field-search-plugin/102/
