Return to Snippet

Revision: 52082
at October 13, 2011 00:09 by maxxscho


Updated Code
function ms_rp_excerpt($limit) {
		$excerpt = explode(' ', get_the_excerpt(), $limit);
		if (count($excerpt) >= $limit) {
			array_pop($excerpt);
			$excerpt = implode(' ', $excerpt).'...';
		}
		else {
			$excerpt = implode(' ', $excerpt);
		}
		$excerpt = preg_replace('`\[[^\]]*\]`', '', $excerpt);
		return $excerpt;
	}

Revision: 52081
at October 13, 2011 00:05 by maxxscho


Initial Code
function ms_rp_excerpt($limit) {
		$excerpt = explode(' ', get_the_excerpt(), $limit);
		if (count($excerpt) >= $limit) {
			array_pop($excerpt);
			$excerpt = implode(' ', $excerpt).'...';
		}
		else {
			$excerpt = implode(' ', $excerpt);
		}
		$excerpt = preg_replace('`\[[^\]]*\]`', '', $excerpt);
		return $excerpt;
	}

Initial URL

                                

Initial Description

                                

Initial Title
Wordpress Excerpt Dynamic Length

Initial Tags

                                

Initial Language
PHP