• Resolved armandl

    (@armandl)


    When I have this plugin active (using Twenty Twelve child Theme), I lose excerpts on my search result page. Any idea what the conflict could be?

    My site requires an LDAP login, so I can’t provide a link.

    On my test site (same child theme, same other plugins, same hosting), the search excerpts are unaffected.

    https://www.ads-software.com/plugins/vanilla-pdf-embed/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter armandl

    (@armandl)

    I’ve isolated what portion of my functions.php file interferes with the search result excerpts:

    //adds attachment thumbnail to search results list
    	function attachments_search_the_excerpt( $excerpt ) {
    		if ( ! is_search() )
    		return $excerpt;
    
    		$id = get_the_ID();
    		if ( ! $id )
    		return $excerpt;
    
    	$caption = wptexturize( get_post($id)->post_excerpt );
    
    	// compile output with thumbnail image
    	$output = "<div id='attachment_{$id}' >";
    	$output .= wp_get_attachment_image( $id, 'thumbnail', true );
    	$output .= "<p class='wp-caption-text'>$caption</p>";
    	$output .= "</div>";
    
    	return $output;
    	}
    	// hook our function to the filter
    	add_filter( 'the_excerpt', 'attachments_search_the_excerpt' );

    This was taken from this support request and works fine with Vanilla PDF embed on my test site.

    Thread Starter armandl

    (@armandl)

    Fixed it, nevermind.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search Excerpt… Any Ideas?’ is closed to new replies.