Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4266476
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:45:56+00:00 2026-05-21T06:45:56+00:00

I need to return an array of post dates in wordpress. So basically if

  • 0

I need to return an array of post dates in wordpress. So basically if I have 10 posts in wordpress, I need to create an array that will return the date that each of the tens posts were created. I don’t need the list to be ordered nor contain any other content. Pretty simple right?!

Something like this:

$myarray = array();
query_posts();
// The Loop         
while ( have_posts() ) : the_post();
   $my_array = the_time('j');
endwhile;

I have attempted many different methods to accomplish this but they have all more or less failed. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T06:45:56+00:00Added an answer on May 21, 2026 at 6:45 am

    You are using the_time which does not return anything which is to display output directly.

    use get_the_time()

    while ( have_posts() ) : the_post();
       $my_array[] = get_the_time('j');
    endwhile;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP file that returns a JSON array. I need to extract
I need to return an array in php and use it in javascript. When
What does array_search() return if nothing was found? I have the need for the
I need to store a char array inside a class and then return it.
I need the following logic. If array contains value , return it else return
I need to return a full directory name from inside a specified directory that
So I need to build an application that will receive xml request and based
With a Jquery $.post can the returned data be an array or return 2
I have a script for updating a database table. I need to return a
Is it possible to do a cURL post with PHP that will post my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.