• Hi All,

    I hope someone can help!? I’ve got the following code to list out sub pages on a page:

    <?php
    // Set up the arguments for retrieving the pages
    $args = array(
        'post_type' => 'page',
        'numberposts' => -1,
        'post_status' => null,
        'post_parent' => $post->ID, // $post->ID gets the ID of the current page
            'order' => ASC,
            'orderby' => title
        );
     $subpages = get_posts($args);
     // Just another WordPress Loop
     foreach($subpages as $post) :
        setup_postdata($post);
     ?>

    I’ve then got <?php the_excerpt(); ?> to display the excerpt if one exists and this in my functions file

    function new_excerpt_length($length) {
    return 10;
    }
    add_filter('excerpt_length', 'new_excerpt_length');
    
    // Changing excerpt more
    function new_excerpt_more($more) {
    return '%u2026';
    }
    add_filter('excerpt_more', 'new_excerpt_more');

    However, the length of text doesn’t shorten. I cannot understand it! Where am I going wrong?

    TIA

  • The topic ‘the_excerpt length isn't working’ is closed to new replies.