Categories

Featured templates

WordPress Cherry 3.x. How to change excerpt length limit

Carey Burns September 22, 2014
Rating: 5.0/5. From 1 vote.
Please wait...

Our Support team is ready to present you a new tutorial that will show you how to change excerpt length limit in WordPress templates.

WordPress. How to change excerpt length limit

Excerpts can be displayed with shortcodes, widgets, you can see the excerpts on your Blog page.

Excerpt length can usually be changed in the corresponding shortcode, widget settings or page template php file.

In case you need to set big value for the excerpt length, you will need to change the excerpt length limit, which is 60 words by default.

In order to change the excerpt length limit, please do the following:

  1. Navigate to “wp-content/themes/CherryFramework” folder on your FTP. Open functions.php file.

  2. Locate the function for the excerpt length, the code will look like the following:

    	 /*
    * Custom excpert length
    *
    */
    if(!function_exists('new_excerpt_length')) {
    
    function new_excerpt_length($length) {
    return 60;
    }
    add_filter('excerpt_length', 'new_excerpt_length');
    }
         

    Please don’t edit this file or any other files inside “CherryFramework” folder.

  3. Copy the function body to themeXXXXX/includes/custom-function.php file. The code you need to copy:

    	 function new_excerpt_length($length) {
    return 60;
    }
    add_filter('excerpt_length', 'new_excerpt_length');
         
  4. Change the excerpt limit in this file now and save changes.

You can set any value less than the new excerpt length limit for the excerpt length.

Feel free to check the detailed video tutorial below:

WordPress. How to change excerpt length limit

Awesome Wordpress Templates
This entry was posted in WordPress Tutorials and tagged change, Cherry, excerpt, length, WordPress. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket