the_content works but the_excerpt doesn't
-
I’ve just inherited a wordpress site (v4.1) and I’m trying to perform the simple task of showing a single blog post from a specific category on the home page. This is my code:
<?php query_posts(array('category_name' => 'people')); $i = 1; if ( have_posts() ) while( have_posts() && $i < 2 ) : the_post(); ?> <?php the_excerpt(); ?> <?php $i++; endwhile; ?>
And it brings back nothing, if I put in
<?php the_content(); ?>
I get the full content of the post.Is there something wrong with my loop, or somewhere else in wordpress I should be looking at to get the_excerpt() working?
Elsewhere in the theme I see this code:
<?php echo apply_filters( 'the_content', apply_filters('the_excerpt', get_the_excerpt() ) ); ?> <?php the_content(); ?>
When I try that in my loop it also just brings back the whole content of the post.
If someone could point me in the right direction I would be very grateful.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘the_content works but the_excerpt doesn't’ is closed to new replies.