• Resolved beingalex

    (@beingalex)


    Hi,

    I have “the_excerpt();” in “index.php”. This works fine, and it is definitetly processing this page and function however, I am trying to limit the amount of words using:

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

    in functions.php. This is getting completely ignored, plus I can’t set a more link on the end using the same technique.

    Has anyone experienced this ?

    Your help is much appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Works okay for me. That filter does not work on the ‘manually’ crafted excerpt, only the excerpt manufactured from the post content.

    Thread Starter beingalex

    (@beingalex)

    Thanks, Michael.

    I didn’t realise that.

    I’ve been trying to figure this out for weeks. This explains a lot.

    Is there any other way to set the length for a hard coded the_excerpt(); function?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Excerpt ignoring set length’ is closed to new replies.