• Resolved nate.ads

    (@nateads)


    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.

    • This topic was modified 5 years, 9 months ago by nate.ads.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Vinod Dalvi

    (@vinod-dalvi)

    I hope you are well today and thank you for your question.

    The Ivory Search plugin searches posts, pages or custom post types by custom field values and display them on the search results and not display custom fields itself as the plugin uses default WordPress search functionality to do it.

    The search results page is displayed by the search.php file of the theme that you are using on your site so the plugin doesn’t control how the pages/posts and its custom fields will be displayed on the search results page but your site theme controls it.

    You can change this developing custom code in the search.php file of your child theme by contacting the theme author or consider hiring a developer to develop it for you. You can hire a developer from any freelance site or WordPress agency.

    You can also consider hiring us to develop it for you using the form https://ivorysearch.com/custom-work/

    Best regards,

    Thread Starter nate.ads

    (@nateads)

    Hi @vinod-dalvi, thank you for your reply and I hope you are doing well also.

    I can try to clarify a bit better.

    You mentioned above

    The Ivory Search plugin searches posts, pages or custom post types by custom field values and display them on the search results

    that is where I am having trouble. I am not trying to display the custom field itself, I am trying to display the value from the custom field in the search result excerpt.

    I’m using the underscores.me skeleton theme.

    I could not find any documentation or references to adding anything on my search results page to display the data from the custom fields. I had assumed the plugin added that field data into the search results output. So I assume I am missing a simple step?

    I am unable to share the working link, so I have whipped up a test one located here.
    http://ivory.nateweb.ca/ using the Twenty Twenty theme as it provides the same results I am having.

    I have created 2 pages. One using the built in block editor and another using 2 ACF PRO fields.

    When you search ‘lorem’
    http://ivory.nateweb.ca/?s=lorem&id=6
    the search results page displays page title and page excerpt as this page only uses the built in block content editor.

    When you search ‘description’
    http://ivory.nateweb.ca/?s=description&id=6
    the search result shows only the page title and no excerpt.

    I’m hoping I simply missed a quick and simple step. Hopefully the above details help to clarify my situation.

    • This reply was modified 5 years, 9 months ago by nate.ads.
    Plugin Author Vinod Dalvi

    (@vinod-dalvi)

    Yes, I understood what you meant but as said above the search results page is displayed by the search.php file of the theme that you are using on your site so the plugin doesn’t control how the search results page or its content displays but your site theme controls it.

    You can change this developing custom code in the search.php file of your child theme by contacting the theme author or consider hiring a developer to develop it for you if you are not a developer.

    Please advise if you have more questions.

    Have a fantastic day!

    Thread Starter nate.ads

    (@nateads)

    @vinod-dalvi thank you for the quick reply and clarifying things.

    Hope you have a fantastic day also.

    Plugin Author Vinod Dalvi

    (@vinod-dalvi)

    You are always welcome here 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘ACF not showing excerpt’ is closed to new replies.