• Resolved Lumostin

    (@lumostin)


    Hi,

    My search results are only showing excerpts for each result for only my posts that have manual excerpts added and not my pages or posts that don’t. Isn’t it possible to have automatic “custom search result snippets” for all posts and pages regardless if there’s manual excerpts for them? I’ve had it work like that before, I believe.

    Below is my search.php code:

    
    <?php 
    /**
     * Template Name: Search Page
     */
    ?>
    <?php get_header(); ?>
    	<div class="container no-hero-banner">
    		<div class="page-entry">
    			<?php global $wp_query; $total_results = $wp_query->found_posts;?>
    				<div class="page-title">
    					<h1>Search Results</h1></div>
    				<h3><?php printf( __( 'Search Results for: %s', 'shape' ), '<span>' . get_search_query() . '</span>' ); ?></h3>
    				<h5> Total Results: <?php echo $total_results ?> </h5>
    
    				<hr>
    
    				<?php if ( have_posts() ) { ?>
    
    					<?php while ( have_posts() ) { the_post(); ?>
    
    						<article class="search-result">
    							<h4><a href="<?php echo get_permalink(); ?>">
    			   <?php relevanssi_the_title();  ?>
    			 </a></h4>
    							<div class="search-excerpt">
    								<?php the_excerpt(); ?>
    							</div>
    							<hr>
    						</article>
    
    						<?php } ?>
    
    							<?php echo bootstrap_pagination($query); ?>
    
    								<?php } ?>
    		</div>
    	</div>
    <?php get_footer(); ?>
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mikko Saari

    (@msaari)

    With that template, your search results should be showing custom excerpts for all posts, if custom excerpts are enabled in the Relevanssi settings. Whether the post has a manual excerpt or not should not make a difference. Can you share a screenshot of your Relevanssi excerpt settings?

    Thread Starter Lumostin

    (@lumostin)

    My apologies! It looks like it was an issue with version 3.3.2 of WP-Members Membership Plugin which has since been rolled back to 3.3.1. Just downgraded and it sorted it self out! My fault for not investigating further.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search Results Only Showing Excerpts For Posts with Manual Excerpts’ is closed to new replies.