skip to Main Content

I am not a WordPress coding expert but I need help from the WordPress experts.

I am using a plugin that creates a Shortcode for posts on the other page. But when i use the shortcode for post, Excerpt is too long but i want to reduce it to 23 words. Can anybody help me how to fix it. Check the URLS.

Screenshot of posts with overflowing excerpt

2

The plugin is called Shortcodes Ultimate.

2

Answers


  1. Assuming you’re using the Posts widget, you just need to pick a different template or create a custom template. Check out the docs for that here.

    Login or Signup to reply.
  2. You can limit the number of text lines with css, add this to style.css (Recommended):

    .su-posts-default-loop .su-post-excerpt p {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        box-orient: vertical;
        -webkit-line-clamp: 2;
        text-overflow: ellipsis;
        line-clamp: 2;
        overflow: hidden;
    }
    

    Or, you can change the length of the WordPress excerpt by adding this code to functions.php:

    function theme_slug_excerpt_length( $length ) {
            if ( is_admin() ) {
                    return $length;
            }
            return 23;
    }
    add_filter( 'excerpt_length', 'theme_slug_excerpt_length', 999 );
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search