Limiting words on excerpt but only on one section/page?
-
Hi there,
I have the following which displays some latest posts on my homepage:
<?php // Define our WP Query Parameters $the_query = new WP_Query( 'posts_per_page=5' ); ?> <?php // Start our WP Query while ($the_query -> have_posts()) : $the_query -> the_post(); // Display the Post Title with Hyperlink ?> <?php the_category(" "); ?> <div class="icon-date"><?php echo get_the_date( 'Y-m-d' ); ?></div> <div><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></div> <div><?php // Display the Post Excerpt the_excerpt(__('(more…)')); ?></div> <?php // Repeat the process and reset once it hits the limit endwhile; wp_reset_postdata(); ?>
What I would like to do is to limit the number of words in the excerpt but only on this section/homepage so other areas of the website aren’t affected.
How would I do this? I have found there is a way to generally do it, but not just per this section.
Any ideas would be great, thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Limiting words on excerpt but only on one section/page?’ is closed to new replies.