Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter cmdshiftdesign

    (@cmdshiftdesign)

    OK, I figured out my issue and it is that I misunderstood the function of the_excerpt.

    I always understood the excerpt to either be the text defined as the excerpt in wordpress OR the first 100 (or whatever) characters in the post. But, looks like I’m wrong. If no text is in the “excerpt” field of a post will the full content just display.

    add this to your functions.php file

    it is a filter that will allow you to control the length of your excerpt by returning 20 that is your excerpt length. That number is then passed into your filter allowing you to manipulate the output. Now whenever you call the_excerpt() it will run you filter.

    // the code below is from the codex

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

    also make sure you are running the_excerpt() in the loop 🙂

    Thread Starter cmdshiftdesign

    (@cmdshiftdesign)

    Thank you! I have that in place in my functions.php file… but i just did a little test — made a function file with ONLY that and it worked… so looks like it is being interfered with with something else in that file…

    the plot thickens…

    Thread Starter cmdshiftdesign

    (@cmdshiftdesign)

    VICTORY!

    that is odd. Did you place that at the end of the functions.php file?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘the_excerpt(); displaying full content’ is closed to new replies.