Go to theme settings in dashboard (Pokemon -> Layout) and set option “Cut content on the Front/Category page” to ON.
Update #1
To change the way posts are displayed only on the search page, you can add || is_search()
after smt_getOption( 'layout', 'cuttxton' )
if( smt_getOption( 'layout', 'cuttxton' ) || is_search() )
But it will be better to save the changed content.php
file under a new name content_search.php
:
<?php if ( !is_single() ) : ?>
<!-- ========== Post content in posts feed ========== -->
<div class="entry-summary">
<?php
if ( ! post_password_required() ) {
smt_excerpt( 'echo=1' );
} else the_content( );
?>
<a href="https://wordpress.stackexchange.com/questions/312423/<?php the_permalink(); ?>" class="button"><?php echo smt_translate( 'readmore' ); ?></a>
<span class="post-categories"><?php the_category(' '); ?></span>
</div><!-- .entry-summary -->
<?php endif; ?>
<div class="clear"></div>
</article><!-- #post-## -->
and in search.php
use the new template file:
// Start the loop.
while ( have_posts() ) : the_post();
get_template_part( 'content_search' );
// End the loop.
endwhile;
Excerpt lenght
The excerpt lenght can be changed with excerpt_length
filter (doc). You can also change length of excerpt in your theme options (“Pokemon” -> “Layout” -> “The default excerpt length”).
Code goes to functions.php
:
function custom_excerpt_length( $length ) {
return 20; // number of words
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );