How can I reduce the number of words per article to be displayed on Archives on my wordpress blog? I just want to limit it to max display it up to 20 to 30 words in the main page of archive for further reading I want users to continue with the ‘More reading’ or ‘continue’ option. Thanks!
Depending on your theme function add functions.php ( example: http://joomquery.com/wp-content/themes/vinaora/includes/custom-functions.php ) add: Get limit excerpt // Get limit excerpt function content_limit($max_char, $more_link_text = '', $stripteaser = 0, $more_file = '') { $content = get_the_content($more_link_text, $stripteaser, $more_file); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); $content = strip_tags($content); if (strlen($_GET['p']) > 0) { echo ""; echo $content; echo "..."; } else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) { $content = substr($content, 0, $espacio); $content = $content; echo ""; echo $content; echo "..."; } else { echo ""; echo $content; } } Code (markup): and in your loop.php ( example: http://joomquery.com/wp-content/themes/vinaora/includes/templates/loop.php ) add <!--end .entry-meta--> <div class="entry-excerpt"> <?php content_limit('240'); ?> </div> <!--end .entry-excerpt--> Code (markup): Number 240 is 240 characters you can changes it to matches with your blog arhive Goodluck
Really thank you so much, i'm really obliged it has solved the problem Good luck to you as well. Thanks!
Try this one dear. Copy and Paste this following code in function.php file. More information- http://witsgroup.in/wordpress.html function custom_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'custom_excerpt_length' );