-
AuthorPosts
-
October 6, 2014 at 10:10 pm #331192
I am using two Blog Post content elements right next to each other, set in two columns at two different widths. It looks like the “Single Author, Big Preview Pic” has an excerpt length of 55, while the “SIngle Author, Small Preview Pic” has an excerpt length of 63. I would like to shorten these elements. I have tried the following with no luck:
add_filter(‘avf_postgrid_excerpt_length’,’avf_increase_postgrid_excerpt_length’, 10, 1);
function avf_increase_postgrid_excerpt_length($prepare_excerpt) { return 40; }Does the content inside the ” need to change?
October 8, 2014 at 3:23 am #332062Hi!
Try with this code instead:
function custom_excerpt_length( $length ) { return 30; } add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 );
Cheers!
JosueOctober 9, 2014 at 8:07 pm #333429Hmm… that’s not working either.
How is the homepage (using Blog Posts: Grid Layout,showing Title and Excerpt) only showing 9 words, but the Insights page (using Blog Posts: Single Author, showing small preview pic w/excerpt) showing 62 words?
October 9, 2014 at 9:36 pm #333457Hi,
Can you please create us a WordPress administrator account? post it here as a private reply.
Regards,
JosueOctober 9, 2014 at 11:43 pm #333492This reply has been marked as private.October 10, 2014 at 1:48 am #333574Hi!
Check out your homepage, excerpt is longer now. I left these two codes in your child functions.php so you can adjust both excerpts as needed:
/* Modify excerpt length (grid) */ function avf_increase_postgrid_excerpt_length() { return 140; } add_filter('avf_postgrid_excerpt_length','avf_increase_postgrid_excerpt_length', 10); /* Modify excerpt length (not grid) */ function custom_excerpt_length( $length ) { return 140; } add_filter('excerpt_length', 'custom_excerpt_length', 999 );
You can also merge them into one single function:
/* Modify excerpt length (global) */ function custom_excerpt_length( $length ) { return 140; } add_filter('excerpt_length', 'custom_excerpt_length', 999 ); add_filter('avf_postgrid_excerpt_length','custom_excerpt_length', 10);
Cheers!
Josue -
AuthorPosts
- You must be logged in to reply to this topic.