Skip to main content

Comments

9 comments

  • Ariel.H

    Hi Kazik,

    It seems you are inquiring about a specific code snippet to limit the length of the excerpt.
    Here is the PHP code snippet you can use to achieve this:

    <?php
    function custom_excerpt_length( $length ) {
        return 30;}
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
    ?>

    This code will restrict the length of the excerpt to 30 words, you may change it as needed.
    Please create a child theme and add it in the functions.php file.

    Or you can use the CodeKit – Custom Codes Editor plugin to add the code snippet into your website - https://i.imgur.com/DXYcPY9.png
    This is tested to work well on this test website - https://sitebuilder1.online/weglot/

    Please try this and let me know how it goes.

    Best regards,
    Ariel H.

    0
  • Kazimierz Karczewski

    Hi Ariel,

    I know how to do it... Unfortunately, the snipet does not work... Snipet is added in the functions.php file in the child theme...

    --
    BR
    Kazik Karczewski

    0
  • Ariel.H

    Hi Kazik,

    I’m currently using Blocky on this test website, where I have used this code snippet -  https://sitebuilder1.online/weglot/

    It may require some modifications to work with your current theme. Could you please provide us the theme you are using on your website, so we can reproduce the issue?

    I am looking forward to your response.

    Best regards,
    Ariel H.

    0
  • Kazimierz Karczewski

    Hi Ariel, 

    I'm using Blocksy-Child theme. I can give you access to the website, it will be faster.

    --
    BR
    Kazik

    0
  • Ariel.H

    Hi Kazik,

    Thank you for the update.

    Please add us as a user to your WordPress Dashboard and send the following details to: communitysupport@brizy.io

    Community Post link: https://support.brizy.io/hc/en-us/community/posts/13696610730514
    WordPress Admin URL:
    Username:
    Password:

    Please make a full backup of your website as a precaution.

    Best regards,
    Ariel H.

    0
  • Kazimierz Karczewski

    DONE.

    --
    BR
    Kazik

     

    0
  • Kazimierz Karczewski

    Hi Ariel.

    Have you received an e-mail with access data to the website?

    --
    BR
    Kazik

     

    0
  • Ariel.H

    Hi Kazik,

    Thank you for your cooperation.

    Upon checking, a custom excerpt was added into the post, which is why the code is not working - https://prnt.sc/AdlQGefzytHn

    Best regards,
    Ariel H.

    0
  • Kazimierz Karczewski

    Hi, Ariel,

    Magick. :) Now its working. Thank you very much for help.

    --
    BR
    Kazik

    0

Please sign in to leave a comment.