Forums Forums Search & Filter Pro Display only titles in search results

Viewing 2 posts - 1 through 2 (of 2 total)
  • Anonymous
    #161555

    I have a client request to display only the titles of the search results. It is currently returning the full post/above the read more tag.

    How can we achieve this? Below is my current search.php code:

    <?php 
    
    get_header();?>
        
        <?php
    	global $smof_data;
    	$layout = isset($smof_data['main_layout']) ? $smof_data['main_layout'] :"";
    	
    	switch ($layout) {
    		case 'rightsidebar':
    			$position ="float:left";
    			break;
    		case 'leftsidebar':
    			$position ="float:right";
    			break;
    		default:
    			$position ="";
    			break;
    	}
        ?>
        
        <?php get_template_part('includes/header_inner'); ?>
    
        <!-- content section start here -->
        <section id="content-wrapper">
               
            <div class="row">
            
                 <div class="<?php if($position){echo'eight column';}else{echo 'twelve column';}?>" style=" <?php echo $position;?> ">
                	
                    <?php if ( have_posts() ) : ?>
                    
    					<?php while ( have_posts() ) : the_post(); ?>
                            <?php get_template_part( 'content-search' ); ?>
                        <?php endwhile;?>
        
                        <?php if (  $wp_query->max_num_pages > 1 ) : ?>
                             <?php if(function_exists('wp_pagenavi')) { ?>
                                 <?php wp_pagenavi(); ?>
                             <?php }else{ ?>
                                    <div class="blog-pagination">
                                        <nav class="navigation">
                                            <div class="nav-previous alignleft"><?php next_posts_link( __( '&larr; Older posts', 'indonez' ) ); ?></div>
                                            <div class="nav-next alignright"><?php previous_posts_link( __( 'Newer posts &rarr;', 'indonez' ) ); ?></div>
                                        </nav>
                                    </div>
                            <?php }?>
                        <?php endif; ?>
                    
                    <?php else : ?>
                    
                       <?php get_template_part( 'content', 'none' ); ?>
                    
                    <?php endif; // end have_posts()?>
                
                </div>
                
                <?php if ($position) { ?>
                    <div class="four column widget_area">
                    <?php echo do_shortcode('[searchandfilter id="2688"]'); ?>
                        <?php get_sidebar(); ?>
                    </div> 
                <?php } ?>
                     
            </div>         
                     
        </section>
        <!-- content section end here -->
        
    <?php get_footer(); ?>
    
    Trevor
    #161561

    You might better off (it will be much easier) using the Shortcode Display Results method. If you follow the customisation guidance, you can edit the results.php file that we provide. See the documentation here:

    https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/

Viewing 2 posts - 1 through 2 (of 2 total)