Display posts titles as lists
-
hi all,
I’m trying to create a list of all posts with date-title(post)-xlines of chars.
I wrote this code… but, its giving some messed(last but first post doesn’t show its date/ as a list) results.
Code is as follows: `
-
<?php
$args=array(
‘showposts’=>0,
‘caller_get_posts’=>1
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
/* echo ‘5 recent Posts’;*/
while ($my_query->have_posts()) : $my_query->the_post(); ?> - <?php the_time(‘m.d.y’) ?> ” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?>
<?php
echo substr($my_query->post->post_content,0,120); //20 chars of content
endwhile;
} //if ($my_query)
wp_reset_query(); // Restore global post data stomped by the_post().
?>
`
-
<?php
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Display posts titles as lists’ is closed to new replies.