Guide to changing the length of article descriptions in the Flatsome theme.

excerpt lenght

The default length of list mode descriptions in category/blog posts is 15 words, which may look too short. To change this length in the Flatsome theme, you can follow these steps: access hosting/vps, locate the archive-list.php file in the theme folders, add ‘excerpt_length’ => ’40’ below a specific line in the code, and save the file. This will adjust the description length to your desired number of characters. Make sure to customize the number accordingly. By making these changes, you can create a more visually appealing list mode layout for your category/blog posts.

When we use list mode in category/blog posts, the default length of the description is 15 words, which may be a bit short and not visually appealing.

So, in today’s guide, I will show you how to change the length of this description in the Flatsome theme. Here’s how you can do it:

Step 1: Access your hosting/VPS and open the File Manager, then navigate to the folder public_html/wp-content/themes/flatsome/template-parts/post. Copy the file archive-list.php to the same path in the Flatsome child theme: public_html/wp-content/themes/flatsome-child/template-parts/post. (If the template-parts and post folders are not present, create them to make this work).

Step 2: Open the file and locate the following section:

echo flatsome_apply_shortcode('blog_posts', array(
    'image_width' => '40',
    'depth' => get_theme_mod('blog_posts_depth', 0),
    'depth_hover' => get_theme_mod('blog_posts_depth_hover', 0),
    'text_align' => get_theme_mod('blog_posts_title_align', 'center'),
    'style' => 'vertical',
    'columns' => 'first',
    'show_date' => get_theme_mod('blog_badge', 'first') ? 'true' : 'false',
));

Add the line 'excerpt_length' => '40', below 'ids' => $ids, and then save the file. After adding, your code should look like this:

echo flatsome_apply_shortcode('blog_posts', array(
    'image_width' => '40',
    'depth' => get_theme_mod('blog_posts_depth', 0),
    'depth_hover' => get_theme_mod('blog_posts_depth_hover', 0),
    'text_align' => get_theme_mod('blog_posts_title_align', 'center'),
    'style' => 'vertical',
    'columns' => 'first',
    'show_date' => get_theme_mod('blog_badge', 'first') ? 'true' : 'false',
    'excerpt_length' => '40',
));

Step 4: Finally, check the results. After making the adjustment, you should see a change in the length of the description as shown in the image below.

See also  Guide on creating menus in WordPress.

Instructions to change the length of the post description in the Flatsome theme

That’s it! Best of luck with your customization!

5/5 - (1 vote)

Related posts