Longer excerpt in slider – Is this code correct??

  • irishgem


    Hi all…

    I have done a ton of searching and reading this board to make changes to my website. So far, everything has been perfect. I want to make the text excerpt longer in the slider (not full text since I do have an image also). I found this code on the form to use in the functions.php file.. It WORKS, but I just want to double check since the post I found it on is almost 2 years old..

    Is there an easier way? Also, Is there supposed to be anything like a dot or something before the word “function” or is this the full code?

    function custom_excerpt_length($length) {
    return 40; // Change this to whatever you want. }
    add_filter('excerpt_length', 'custom_excerpt_length');

    Thank you SO MUCH!! I don’t know much about coding, so I want to make sure this is correct.


    Kenneth John Odle


    Should be good, afaik. Let us know if you see anything strange, though.

    I found this code on the form to use in the functions.php file

    Um…that is a child theme functions.php, right?



    What do you mean child theme? I am still not clear on what child theme is..



    Graphene – https://forum.graphene-theme.com/graphene-support/how-to-modify-the-theme-using-a-child-theme

    WordPress – http://codex.wordpress.org/Child_Themes

    It will allow you to make customizations to your website, without them being overwritten whenever you update your theme.



    Thank you!

    ANy help with the code I posted??


    ANy help with the code I posted??

    What exactly is your question?



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

  • You must be logged in to reply to this topic.