the_content_limit
-
This is kind of a 101 question on the_content_limit – but I have an inconsistency that I’m frustrated with and need a second opinion.
I have the following site below that uses the_content_limit to post up the latest 280 of a post, and it’s set to show the latest 2 posts.
https://www.warningfallingwaterfowl.com/
What’s odd is when you click on a post, the sidebar shows the latest 2 posts in it’s entirety, ignoring the 280 limit. I can’t figure out why it respects the limit on the homepage, but not in the posts.
Here is the code I’m using:
<?php $recent = new WP_Query("showposts=2"); while($recent->have_posts()) : $recent->the_post();?> <?php if( get_post_meta($post->ID, "thumbnail", true) ): ?> <img style="float:left; border: 1px solid #000000; margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="<?php the_title(); ?>" /> <?php else: ?> <?php endif; ?> <b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b> <?php the_content_limit(280, ""); ?> <div style="border-bottom:1px dotted #94B1DF; margin-bottom:10px; padding:0px 0px 10px 0px; clear:both;"></div> <?php endwhile; ?>
Anyone have any ideas? Many thanks in advance.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘the_content_limit’ is closed to new replies.