• Hello,
    I am working on the following website: https://66.199.45.174/

    I am have problems with the excerpt length, it is only 2 words!

    I have tried using the following code:

    function custom_excerpt_length( $length ) {
    	return 20;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

    as stated in the following topic: https://www.ads-software.com/support/topic/excerpt-size?replies=4

    However, adding this excerpt to my child theme’s functions.php breaks the website altogether. Here is my child theme’s functions.php as of now:

    <?php
    /*
    * Generated By Orbisius Child Theme Creator - your favorite plugin for Child Theme creation :)
    * https://www.ads-software.com/plugins/orbisius-child-theme-creator/
    *
    * Unlike style.css, the functions.php of a child theme does not override its counterpart from the parent.
    * Instead, it is loaded in addition to the parent’s functions.php. (Specifically, it is loaded right before the parent theme's functions.php).
    * Source: https://codex.www.ads-software.com/Child_Themes#Using_functions.php
    *
    * Be sure not to define functions, that already exist in the parent theme!
    * A common pattern is to prefix function names with the (child) theme name.
    * Also if the parent theme supports pluggable functions you can use function_exists( 'put_the_function_name_here' ) checks.
    */

    Is there something wrong here? Please advice, thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jolera2016

    (@jolera2016)

    I’ve added a plugin called “Easy Custom Auto Excerpt” and it seems to only add excerpts when I pick the “paragraph” option, I cannot truncate the excerpts based on characters for whatever reason.

    I have confirmed this with another plugin called “Multiple excerpts” that truncates by character also, but seems to do nothing.

    Any news on why I’m having to battle the excerpts so much?

    thanks

    Hello,

    Please prefer this doc for creating child theme
    https://docs.themeisle.com/article/14-how-to-create-a-child-theme

    I hope it will solve your issue.

    Regards,
    Gourav

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