Post Content Recent Posts
-
Hello I have made a widget of my own using part of the blog php code and I want to be able to restrict how much of the_content is displayed E.G. – First 20 words
Is this possible
Please let me know
Code I am using is below
<?php
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
$wp_query->query(‘showposts=5′.’&paged=’.$paged);
if ($wp_query->have_posts()) : while ($wp_query->have_posts()) : $wp_query->the_post();
global $more; $more = 0;
?>
<div id=”post_space”>
</div><div class=”post_title”>
” rel=”bookmark” title=”<?php the_title(); ?>”><?php the_title(); ?>
</div><div class=”post_date”>
<?php the_time( get_option( ‘date_format’ ) ); ?>
</div><?php the_content(__(‘Read more’));?><div style=”clear:both;”></div>
<?php endwhile; else: ?><p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p><?php endif; ?>
<p><?php posts_nav_link(‘ — ‘, __(‘« Previous Page’), __(‘Next Page »’)); ?></p>
<?php $wp_query = null; $wp_query = $temp; ?>
- The topic ‘Post Content Recent Posts’ is closed to new replies.