ACF not showing excerpt
-
Thanks for this great plugin, works great right out of the box. I am encountering a small issue though with ACF. My search results are not showing any ACFs.
The steps I have taken were…
1. Created a new search form.
2. Under ‘Search Forms/*New Form Name*/Includes/Pages/Search selected page custom fields values.
3. I checked off the custom fields I want to index (no image URLS, no hyperlinks, etc).
4. Saved form.But I am getting no output on the search page results excerpt ‘div.entry-summary’.
My pages using the WP built in content editor field display fine though.
The only solution I have found was to run this code in my functions.php
function excerpt_function($ID, $searchTerms) { global $wpdb; $thisPost = get_post_meta($ID); foreach ($thisPost as $key => $value) { if ( false !== stripos($value[0], $searchTerms) ) { $found = substr(strip_tags($value[0]), 0, 80); echo $found . ' ...'; } } }Ideally I would prefer not to run the above code and leave everything up to Ivory Search.
Any help or direction on where I might be going wrong would be great as it looks like Ivory Search has the ability to do this quite easily.
The topic ‘ACF not showing excerpt’ is closed to new replies.