On my website (shown in Signature) I want to change thae excerpt length on spotlight slider...as guided in support forum related function exists in file inc/spotlight.php line 525. At line 525 whai I did find is <?php the_excerpt(); ?> Now I am stuck how do I define word limit in this funtion...........anyone can help??? Support forum link http://support.industrialthemes.com/viewtopic.php?f=1&t=181&p=544&hilit=excerpt+length#p544
You will use this function the_content_word($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') { $content = get_the_content($more_link_text, $stripteaser, $more_file); $content = apply_filters('the_excerpt', $content); $content = str_replace(']]>', ']]>', $content); $content = strip_tags($content); if (strlen($_GET['post']) > 0) { echo $content; } else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) { $content = substr($content, 0, $espacio); $content = $content; echo $content; echo "."; } else { echo $content; } } And call <?php echo the_content_word('100');?> instead of <?php the_excerpt(); ?> It will help you or you will contact me via Skype/Gtalk: ashishkg17
[From the WP Codex] function custom_excerpt_length( $length ) { return 20; // where '20' is whatever number of words you want } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); PHP: Place these three lines in your theme's functions.php file.