I've just gone live with www.oceanblueclothing.com and wanted to increase the description on the Image rollover on the frontpage.

content(10);
If we then take a look at the content() function we have this function
function content($num) {
$theContent = get_the_content();
$output = preg_replace('/
$output = preg_replace( '/
.*<\/blockquote>/', '', $output );
$output = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $output );
$limit = $num+1;
$content = explode(' ', $output, $limit);
array_pop($content);
$content = implode(" ",$content)."";
return $content;
}
I've now created this function instead
function lrip_content($num) {
$theContent = get_the_content();
$output = preg_replace('/
]+./','', $theContent);
$output = preg_replace( '/
$theContent = get_the_content();
$output = preg_replace('/
$output = preg_replace( '/
.*<\/blockquote>/', '', $output );
$output = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $output );
$limit = $num+1;
$content = substr($output, 0, $num);
return $content;
}
Then on index.php you can call it up with this code, using the number to limit to the size you want it to !
echo lrip_content(30);
No comments:
Post a Comment