In Theme Panel, if im not mistaken ‘Excerpt Length’ is the amount of text shown in the preview of the post. I have it set to 14 (http://screencast.com/t/EPLVL5YsWK2r) but it still seems to display over 14 words (http://screencast.com/t/bi2Hma5Qz4BE) – any suggestions?
I usually over-ride this in the functions.php file as best way.
http://codex.wordpress.org/Function_Reference/the_excerpt
Don’t forget WordPress has awesome documentation on a lot of this kind of thing.
To wit:
Control Excerpt Length using Filters
By default, excerpt length is set to 55 words. To change excerpt length to 20 words using excerpt_length filter, add the following code to functions.php file in your theme:
function custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
Currently the area in functions.php looks like:
/* ----------------------------------------------------------------------------
excerpt lenght
*/
add_filter('excerpt_length', 'my_excerpt_length');
function my_excerpt_length($length) {
// on feed show full content if it's set in wordpress
if (is_feed() and get_option('rss_use_excerpt') == 0) {
return 999999;
}
$excerpt_length = td_util::get_option('tds_wp_default_excerpt');
if (!empty($excerpt_length) and is_numeric($excerpt_length)) {
return $excerpt_length;
} else {
return 20; //default
}
}
I adjusted the ‘return’ but that still doesn’t work. Where do I add your adjustment?
Hi,
Thanks Christopher!
@sbo
Thanks for reporting this, I have tested this and seems it’s not working, we will look at this and added it on our issue list try to fix it as soon as possible, until we fix this you can set the excerpt on modules, I have tested it and work fine.
Sorry about this!
Thanks for the message!
Hi,
After a closer look I have noticed that the WordPress default option from theme panel is used only for feed excerpt and for plugins that use the WordPress excerpt length, that is why it dose not work on modules, as I mentioned before you can change the excerpt an any module using the theme panel for each module so this way you will be changing all the excerpts on your site.
We will change this and we will point out that the WordPress default option is for feed.
Sorry for the inconvenience and thanks for the message!
Hi,
I have tested the excerpt on each module using the latest theme version (4.2.2) and works fine. Make sure you do this right following this guide: https://forum.tagdiv.com/how-to-change-the-excerpt-length/
You can add the excerpt that you want for each post using the excerpt filed from post editing panel: http://screencast.com/t/9vpdduYY
Thanks
Hi,
Please use this custom css to hide the excerpt on block 2/6:
.td_block6 .td-post-text-excerpt, .td_block2 .td-post-text-excerpt{
display: none;
}
For module 7 you don’t have a class that you can use to hide the excerpt so you can edit the module 1 file and add this class: http://screencast.com/t/MuGmEcxOAzpg then use it to hide the excerpt like this: http://screencast.com/t/MuGmEcxOAzpg
.module_7_excerpt {
display: none;
}
Thanks
Hi,
I have tested this before and should work fine. Make sure you do as I suggested, add the class and use the css. If you still can’t manage to do it please provide more details and also provide your site’s URL with an module 7 set so I can inspect this.
Thanks
