Hi!
I would like to use something similar to the Recent Posts widget, but I would like to show the time when the post was published after the listed title.
Can anyone show me in the right direction, thanks!
-Paul
Hi!
I would like to use something similar to the Recent Posts widget, but I would like to show the time when the post was published after the listed title.
Can anyone show me in the right direction, thanks!
-Paul
<?php
//display 10 posts with title and date
$args=array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => 10,
'caller_get_posts'=> 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo 'List of Posts';
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a> - <?php the_time('m.d.y') ?></p>
<?php
endwhile;
}
wp_reset_query(); // Restore global post data stomped by the_post().
?>thanks, it looks a bit similar to the solutions I got at the thematic forum (http://themeshaper.com/forums/topic/how-to-show-time-when-listing-recent-posts) which works with the php code widget.
which works with the php code widget.
So does the code above...
This topic has been closed to new replies.