So I am trying to create a wordpress plugin that stores all the dates of posts written in a certain month. So if there were posts published on the 10th, 12th and 18th of this month, I want to store those dates '10', '12' and '18' in the array $stack[]. Im new to php and so I can't figure out why this isn't storing the dates in the array:
// The Query
$themonth = date( 'n', current_time( 'timestamp' ) );
query_posts('cat=4&month=' . $themonth );
// The Loop
$stack = array();
while ( have_posts() ) : the_post();
$stack[] = the_time('j');
endwhile;
Any ideas?