Viewing 14 replies - 1 through 14 (of 14 total)
  • Theme Author Tom

    (@edge22)

    Hi there,

    Our Blog add-on allows you to do that in the Customizer.

    Otherwise, you can use the excerpt_length filter:

    add_filter( 'excerpt_length','tu_custom_excerpt_length', 20 );
    function tu_custom_excerpt_length() {
        return 50; // Integer stating the number of words
    }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    • This reply was modified 7 years, 8 months ago by Tom.
    Thread Starter Melodyk

    (@melody62)

    Thank you Tom for replying and offering me something that might help but sadly it doesn’t.

    I had tried that already in functions.php of the GeneratePress (Mother) -theme … as well as changing the amount in funcions.php of Forefront theme itself…

    Theme Author Tom

    (@edge22)

    What version of GP are you using?

    Thread Starter Melodyk

    (@melody62)

    1.3.46

    The one that came with Forefront as I downloaded it…

    Theme Author Tom

    (@edge22)

    Any chance you can link me to your blog page?

    Thread Starter Melodyk

    (@melody62)

    ?? in my first post beneath my name ??
    https://melodymusic.nl

    Theme Author Tom

    (@edge22)

    Ugh, sorry about that! ??

    Can you try changing your blog post content option to “Excerpt” in Customize > Blog?

    Thread Starter Melodyk

    (@melody62)

    Thank you Tom for helping me!

    I don’t have to change it because that is the setting already.

    The reason you don’t see it is because I choose a content type other then Standerd, and U use the wp-read more function in a separate post ??

    To let you see what you need I’ve changed the settings of this post…
    https://melodymusic.nl/onherstelbare-schade/

    Greetings

    Theme Author Tom

    (@edge22)

    Ah, if you use the more tag (https://docs.generatepress.com/article/using-the-more-tag/), your excerpt length you have set will be ignored, and the excerpt will cut off wherever you manually applied the more tag.

    If you don’t use the more tag, then the value you set in the above function will work.

    Let me know if that makes sense or not ??

    Thread Starter Melodyk

    (@melody62)

    Hi There

    I’ve started to use the more-tag because the excerptsetting does not work ??

    What you are saying makes sense but I wish it worked like it should ??

    Thread Starter Melodyk

    (@melody62)

    the post I linked you … in there I did not use the more tag… so you could see that the excerptfunction does not work as it is supposed to

    Theme Author Tom

    (@edge22)

    What value did you set in the custom function I provided above?

    Thread Starter Melodyk

    (@melody62)

    Sorry … out all day..

    5

    Theme Author Tom

    (@edge22)

    Hmm, that is very strange.

    Give this function a shot instead of the one above:

    add_filter( 'excerpt_length','tu_custom_excerpt_length', 100 );
    function tu_custom_excerpt_length() {
        return 5; // Integer stating the number of words
    }

    Make sure the post you’re testing doesn’t have the more tag added ??

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Exccerpt length’ is closed to new replies.