NiceThemesHow to set up excerpts & "Read More!" – NiceThemes http://nicethemeswp.com/forums/topic/how-to-set-up-excerpts-read-more/feed/ Sun, 20 Apr 2025 20:18:47 +0000 http://bbpress.org/?v=2.5.12-6148 en-US http://nicethemeswp.com/forums/topic/how-to-set-up-excerpts-read-more/#post-5144 <![CDATA[How to set up excerpts & "Read More!"]]> http://nicethemeswp.com/forums/topic/how-to-set-up-excerpts-read-more/#post-5144 Thu, 08 Jan 2015 22:53:50 +0000 educenter Dear Juan,

Please see below at our layout – the posts do not contain excerpts with the “Read More” link.

What part of the PHP code governs this? I would like to make it so that all posts are excerpts, and you click on “Read more” to access the full post.

Thanks for your help..

]]>
http://nicethemeswp.com/forums/topic/how-to-set-up-excerpts-read-more/#post-5146 <![CDATA[Reply To: How to set up excerpts & "Read More!"]]> http://nicethemeswp.com/forums/topic/how-to-set-up-excerpts-read-more/#post-5146 Fri, 09 Jan 2015 18:50:09 +0000 Andrés Villarreal Hi,

You’re gonna need to override the nice_excerpt() PHP function by putting the following code right at the end of your functions.php file, or inside a child theme (http://codex.wordpress.org/Child_Themes):

function nice_excerpt( $length = 200 ){
	$nice_excerpt = substr( get_the_excerpt(), 0, $length ); //truncate excerpt according to $len
	if ( strlen( $nice_excerpt ) < strlen( get_the_excerpt() ) ) {
		$nice_excerpt = $nice_excerpt . "...";
	}
	echo "

" . $nice_excerpt . "" . "\n"; if ( strlen( get_the_content() ) > $length ) { echo '' . __( 'Continue reading', 'nicethemes' ) . ''; } }

You can customize the text and markup for the link (printed at the end of the function) to your own needs.

Please let me know how it goes.

Best,

Andrés.

]]>