KoderyBeta

Custom Lengh Content

Category: WordPress - Owner: PaulDavis - Owner ID: 1

Lets you define the lengh of the content show.

Place this within your functions.php file and call like content(50). The number is the amount of words shown.

function content($num) {
	$theContent = get_the_content();
	$output = preg_replace('/<img[^>]+./','', $theContent);
	$limit = $num+1;
	$content = explode(' ', $output, $limit);
	array_pop($content);
	$content = implode(" ",$content)."...";
	echo $content;
}