Wednesday, February 2, 2011

Character Limit (Pages & Posts) content

Just open your home.php. This file is located in your theme folder. Open this file with your text editor.

find this line in your home.php file -

<?php the_content('Read the rest of this entry &raquo;'); ?>

Replace with this

<?php 
$content = get_the_content($more_link_text, $stripteaser, $more_file);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo substr(strip_tags($content), 0, 250).'…' ; 
?>


Now do same with your index.php file.
That's all...

No comments:

Post a Comment