Tagged: custom excerpt
-
AuthorPosts
-
October 23, 2015 at 9:42 pm #524119
Hey guys,
This is specific to using a custom excerpt (Screen Options -> Excerpt) and using a Blog Posts (Grid) or Post Slider to display posts. Currently these excerpts are not shortening using any methods I’ve found on the this forum or through other functions I’ve found.
The custom excerpt is shortening when using non-grid layouts for posts.
Can you help?
October 26, 2015 at 5:34 pm #525079Hi grahamonak!
Are you using the Post Slider there? Unless the post is using the link format it should be displaying the excerpt. Try deactivating all of your plugins. If that does not help then send us a WordPress login and we’ll take a look.
Cheers!
ElliottOctober 26, 2015 at 5:42 pm #525089Here’s info for you to login
October 26, 2015 at 7:00 pm #525140Hey!
I’m getting an invalid username error.
Please double check the username you provided above.
Cheers!
DakeOctober 26, 2015 at 7:02 pm #525142Sorry, wrong login URL – correct info is below:
October 26, 2015 at 7:18 pm #525147Hi!
Like Elliot stated previously we would suggest activating the read more link in your post slider.
Also your two latest excerpts are using the full text of the post, so it’s best to shorten it manually via the screen option excerpt:
http://gaintapdevsite-02.com/wp-admin/post.php?post=557&action=edit
Best regards,
DakeOctober 26, 2015 at 7:30 pm #525156Setting the blog slider to “title, excerpt and read more link” does nothing for shortening the custom excerpt, I’m illustrating that on this page:
http://gaintapdevsite-02.com/resources/case-studies/
The top blog post is set to single author pic, the bottom blog post section is set to grid layout. It shortens on the single layout with pic setting, it doesn’t shorten for the grid layout.
The problem with the custom excerpt not shortening appears to be related specifically to posts displaying on the grid layout.
October 28, 2015 at 9:45 am #525956Hi!
Use this in the functions.php file:
add_filter('avf_postgrid_excerpt_length','avf_postgrid_excerpt_length_mod', 10, 1); function avf_postgrid_excerpt_length_mod($length) { $length = 20; return $length; }
Regards,
IsmaelOctober 28, 2015 at 4:51 pm #526277Hi Ismael,
Thanks but that doesn’t apply to custom excerpts. It only affects the length of the default excerpts.
I’m talking about manually set excerpts set on the page / post at the bottom after turning on excerpts in Screen Options.
This is the code I’m using to shorten custom excerpts that is working for posts unless they are set to post-grid layout
function wp_trim_all_excerpt($text) { // Creates an excerpt if needed; and shortens the manual excerpt as well global $post; $raw_excerpt = $text; if ( '' == $text ) { $text = get_the_content(''); $text = strip_shortcodes( $text ); $text = apply_filters('the_content', $text); $text = str_replace(']]>', ']]>', $text); } $text = strip_tags($text); $excerpt_length = apply_filters('excerpt_length', 80); $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]'); $text = wp_trim_words( $text, $excerpt_length, $excerpt_more ); //since wp3.3 /*$words = explode(' ', $text, $excerpt_length + 1); if (count($words)> $excerpt_length) { array_pop($words); $text = implode(' ', $words); $text = $text . $excerpt_more; } else { $text = implode(' ', $words); } return $text;*/ return apply_filters('wp_trim_excerpt', $text, $raw_excerpt); //since wp3.3 } remove_filter('get_the_excerpt', 'wp_trim_excerpt'); add_filter('get_the_excerpt', 'wp_trim_all_excerpt');
October 29, 2015 at 7:59 am #526566Hey!
If you’re using the Excerpt box, why would you add a paragraph or summary that long?
Best regards,
IsmaelJuly 15, 2016 at 2:13 pm #661279Basically, how do I limit the words on a custom post excerpt grid view and add a read more link at the bottom of it. I want to create a nice magazine post layout and need to use the custom post editor but miss out on all the basic functions of a regular post – can someone help? Please
July 17, 2016 at 10:47 am #661716Hi @paulseager,
Please open a new thread and include admin login details in private so that we can have a closer look.
Thanks,
RikardJuly 17, 2016 at 12:23 pm #661728Thanks for this…
July 20, 2016 at 2:02 pm #662958Hi,
this is basic/default WordPress behavior, so refer to:
and
Let us know if you have any specific theme related issues/questions.
Best regards,
AndyJuly 23, 2016 at 1:08 pm #664174Hi Richard… back of holidays now… Included the log in details for the site in question.. I am struggling to limit the excerpts when using the post Advanced builder in Enfold. Also How do you add a read more in the excerpt. I really want the article to behave like a normal blog but I still need to design the post an make it look more attractive. Can you help please?
July 23, 2016 at 1:09 pm #664176It is specifically when using the Blog Post Grid layout that I am struggling. Thanks
July 25, 2016 at 11:37 am #664552Hi,
when using ALB for blog posts you’re losing any WordPress’ default blog behavior. This means you have to do everything from scratch, including any excerpts.
Best regards,
Andy -
AuthorPosts
- You must be logged in to reply to this topic.