You can follow the instructions here to add a new section to Omnisearch:
http://jetpack.me/support/omnisearch/
If you don’t feel comfortable doing so, you can contact the Advanced Custom Fields plugin authors and ask them if they’d consider adding this to their plugin.
Hi,
Thanks for your reply.
From what you link to I cannot see how this should cover searching within Advanced Custom Fields?
Wouldn’t it be more obvious to ask you to consider adding Advanced Custom Fields search support for JetPack? That would truely be great!
Sorry, I should have been more precise. The relevant part is under the “Adding a Results section”:
http://jetpack.me/support/omnisearch/#adding-results
Wouldn’t it be more obvious to ask you to consider adding Advanced Custom Fields search support for JetPack? That would truely be great!
Unfortunately, that’s not something we can do. There are many other plugins adding custom post types and custom data to WordPress, it’d be impossible to support them all within Jetpack. However, we’ve added the necessary filters to Jetpack so the plugin can easily be extended to fit everyone’s needs, without having to change Jetpack itself.
I hope this helps!
Ok, thanks! But the documentation doesn’t explain what add in order to make search within custom fields possible?
add_filter( 'omnisearch_results', 'my_omnisearch_results', 10, 2 );
function my_omnisearch_results( $results, $search_term ) {
$html = '<h2>My Omnisearch Results</h2>';
$html .= '<p>You just searched for <em>' . esc_html( $search_term ) . '</em>!</p>';
$results['My Results'] = $html;
return $results;
}
How will this be possible with your snippet:
http://adambalee.com/search-wordpress-by-custom-fields-without-a-plugin/
?
This tutorial explains to add custom fields to the default WordPress Search functionality. Omnisearch is a bit different, as it can only be used from your dashboard, inside the Jetpack > Omnisearch menu. You consequently won’t be able to follow that tutorial to add ACF to Jetpack’s Omnisearch module.
You can, however, check how we’ve extended Omnisearch for other things, like plugin search:
https://github.com/Automattic/jetpack/blob/master/modules/omnisearch/omnisearch-plugins.php
I hope this helps.
Hi,
Thanks! I’ll look further into this 🙂