Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #1335432

    Hi Guys,
    How can I adjust the excerpt length in enfold.
    I looked for this code in your artilce:
    but could not find the exact match?
    $prepare_excerpt = !empty($entry->post_excerpt) ? $entry->post_excerpt : avia_backend_truncate($entry->post_content, apply_filters( ‘avf_postgrid_excerpt_length’ , 60) , apply_filters( ‘avf_postgrid_excerpt_delimiter’ , ” “), “…”, true, ”);

    Where could I find the right code to change or can I do this more simply in Enfold itself?

    Thanks for your anticipated help:)


    Hey Kevin,

    Thanks for contacting us!

    Which element are you using? If you are using grid style on Blog Posts element, please add following code to bottom of Functions.php file of your child theme –

    add_filter('avf_postgrid_excerpt_length','avia_change_postgrid_excerpt_length', 10, 1);
    function avia_change_postgrid_excerpt_length($length)
       $length = 100;
       return $length;

    Best regards,


    Hi Yigit
    I already tried that code – in my main functions.php file – but it did not work?
    Any other suggestions?


    I found this code:
    // Excerpt length
    function custom_excerpt(){
    // trim sentence by 22 words
    function trimByWord(sentence,wordcount = 22) {
    var result = sentence;
    var resultArray = result.split(” “);
    if(resultArray.length > wordcount){
    resultArray = resultArray.slice(0, wordcount);
    result = resultArray.join(” “) + “…”;
    return result;
    jQuery(‘.post-entry’).each(function() {
    jQuery(“.entry-content “).text(function(index, currentText) {

    return trimByWord(currentText);
    jQuery(“.entry-title a”).text(function(index, currentText) {
    return trimByWord(currentText,15); // trim title by 15 words
    add_action(‘wp_head’, ‘custom_excerpt’);

    on this article:
    But did work – bit I was not sure if this was the best option?


    Sorry, I meant to say – it did work! However, is this the better option?


    Hey Kevin,

    Which element are you using? The code you posted uses jQuery. I think using filters would be better option.

    If you are using Magazine element, please use following code

    add_filter('avf_magazine_excerpt_length','avf_magazine_excerpt_new_lenght', 10, 1);
    function avf_magazine_excerpt_new_lenght($excerpt) {
    $excerpt = 100;
    return $excerpt;

    If you are using Masonry element, please use following one

    add_filter( 'avf_masonry_excerpt_length', 'masonry_excerpt_length');
    function masonry_excerpt_length() {
    $excerpt = 200;
    return $excerpt;

    And if you are using Accordion element, please use following

    add_filter( 'avf_aviaccordion_excerpt_length', 'slider_excerpt_length');
    function slider_excerpt_length() {
    $excerpt = 200;
    return $excerpt;



    Hi Yigit,
    Yes this is now working on the blog page masonry, with 3 columns.
    However, I wanted it to work on the home page where i have the “latest news” with 4 columns – but I cannot seem to get this working?


    Thank you for your patience it looks like you are using version 4.7.6, please update to v4.8.8 and then check, if it is still not working please include an admin login in the Private Content area so we can investigate.

    Best regards,

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.