• Resolved McFarnell

    (@mcfarnell)


    Greetings!

    I am doing a custom wp loop to list my events along with blog posts. I am sorting by published date, which works great. However, I would like to DISPLAY the published date with each event. Inside the loop, I am using the_date();. However, this is displaying the event start date, not the published date. I’ve searched and searched and cannot find how to display the published date.

    I know the published date is saved in the database somewhere, because it shows in the Dashboard area. Anyway I can print it out with the event post in the loop? Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Abz

    (@abzlevelup)

    Hi @mcfarnell, that’s a good question. the_date(), is the function used by WP by default. I also tried it and was able to get the same result, with the start date. I reached out to our team since there might be a certain variable or function to show the published date.

    I’d get back to you as soon as I know more.

    Best,
    Abz

    Thread Starter McFarnell

    (@mcfarnell)

    @abzlevelup Thank you for getting back to me. I finally found I could use this to get the published date:
    $date = mysql2date(‘F d, Y’, get_post_time(‘Y-m-d H:i:s’, true), false);

    Plugin Support Abz

    (@abzlevelup)

    Hi @mcfarnell, I was able to confirm with one of our devs that you could use something like this as well:

    echo get_the_date( 'M d, Y', $event->ID )

    Let me know if this helps.

    Best,
    Abz

    Plugin Support Abz

    (@abzlevelup)

    Hey @mcfarnell, this thread has been inactive for a while, so we’re going to go ahead and mark it Resolved. Please feel free to open a new thread if any other questions come up, and we’d be happy to help.

    Cheers,
    Abz

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom Loop, need published date’ is closed to new replies.