Forums

Showing the posts and a little bit of content (3 posts)

  1. zzzreyes
    Member
    Posted 2 years ago #

    So I got the code to spit out the last 10 stories that I wanted, now all I want is to show about 80 words of content from each story, so I am using the <?php the_content_limit(80, ""); ?> which I can't find any reference to, but it seems to work on some templates. I have tried enabling the plugin limit post options, but it doesnt work on this template... anyone can give me a quick fix?

    code below..

    <?php $recent = new WP_Query("showposts=10"); while($recent->have_posts()) : $recent->the_post();?>
    				<div style="border-top:1px dashed #94B1DF;border-bottom:1px dashed #94B1DF;  margin-bottom:10px; padding:6px 6px 6px 6px; clear:both;">
    				<b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b><br />
    				<?php the_time('l, F jS, Y') ?><br /><br />
    				<?php the_content_limit(80, ""); ?>
    
    				</div>
    
    				<?php endwhile; ?>
  2. stvwlf
    Member
    Posted 2 years ago #

    the_content_limit() is not part of WordPress.

    According to a search I just did, it is part of an old plugin found here.
    http://labitacora.net/index.php?p=152

    Although it is from 2005, according to this it still works.
    http://wordpress.org/support/topic/217004?replies=4

    More typically one uses the_excerpt(), which is built into WP and limits it to 55 words. There is a lot of code floating around to show how to install your own function to modify that limit from 55 to whatever you wish it to be.

  3. zzzreyes
    Member
    Posted 2 years ago #

    Hey thanks! that worked like a charm!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.