Longer excerpt in slider – Is this code correct??

  • irishgem

    #7992

    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.

    Mod

    Kenneth John Odle

    #40006

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

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

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

    irishgem

    #40007

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

    Anonymous

    #40008

    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.

    irishgem

    #40009

    Thank you!

    ANy help with the code I posted??

    Anonymous

    #40010
    Quote:
    ANy help with the code I posted??

    What exactly is your question?

    Anonymous

    #40011

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

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