Support » Fixing WordPress » Get the date of a post for each post
3 years, 10 months ago
Hello WordPress users,
I’m currently building a website where I would like to display the date of a post on the hompage.
Currently I’m using the following code to do this:
$args = array( 'numberposts' => 2, 'category' => 2 );
$postslist = get_posts( $args );
foreach($postlist as $post) :
<?php the_date(); ?> , <?php the_author(); ?>
But this code is only working for the first post.
The first post displays:
april 1, 2013, admin
But all the other posts displays:
I can’t find out what is going wrong here.
Someone who can help me out?