Manually Add Read More Button

How can we add a a read more button on our blog page? I know how to have it give me a read more button automatically, but on some I want to show up when there is a read more tag in the wordpress post editor. When I insert a read more tag in the WordPress post editor, it just cuts off the text on the homepage. You can see our site at clearlakeschools.org. The post I want to manually add a read more button on is the school supply post.

Thanks!

Hi There,

Please manually add the excerpt to the school supply post:

After that add this code under functions.php file locates in your child theme:

function manually_added_excerpt_more( $excerpt ) {
	$excerpt_more = '';
	if( has_excerpt() ) {
        
	            $stack = x_get_stack();
			    if ( $stack == 'integrity' ) {
			      $excerpt_more =  ' ... <div><a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a></div>';
			    } else if ( $stack == 'renew' ) {
			      $excerpt_more = ' ... <a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a>';
			    } else if ( $stack == 'icon' ) {
			      $excerpt_more =  ' ... <a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a>';
			    } else if ( $stack == 'ethos' ) {
			      $excerpt_more =  ' ... <a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a>';
			    }
       
	}
	return $excerpt . $excerpt_more;
}
add_filter( 'get_the_excerpt', 'manually_added_excerpt_more' );

The code above will add the read more button to the posts which have the excerpt.

Let us know how it goes!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.