davidpetrey
6/8/2016 - 3:28 PM

use the_excerpt to truncate post

use the_excerpt to truncate post

 <?php the_excerpt(); ?>

// ABOVE GOES IN THE LOOP BELOW IN THEME FUNCTIONS

//Replaces the excerpt "Read More" text by a link
function new_excerpt_more($more) {
    global $post;
	  return '...' . '<div class="read-more"><a href="'. get_permalink( get_the_ID() ) . '">READ MORE</a><div>';
}
add_filter('excerpt_more', 'new_excerpt_more');

// ---OR USE THIS ONE---

function new_excerpt_more( ) {
    return '...' . '<div class="read-more"><a href="'. get_permalink( get_the_ID() ) . '">READ MORE</a><div>';
}
add_filter( 'excerpt_more', 'new_excerpt_more' );