WordPress.org

Forums

Event post
[resolved] Include event datas in a specific place of the loop (4 posts)

  1. Samuel RM
    Member
    Posted 1 year ago #

    Hi, at first big up for the plugin, seems to work like a charm.

    I'm actually working on a custom theme and I'd like to include event datas such as "begin" and "end" dates in my index.php loop – like after each post title – to display them on my homepage.

    Is it possible to call these datas using simple php calls like <?php the_date(); ?> or is there any other simple solutions?

    I have tried for hours, I must admit I dont speak wordpress very fluently yet.

    Thanks a lot!

    https://wordpress.org/plugins/event-post/

  2. Bastien Ho
    Member
    Plugin Author

    Posted 1 year ago #

    Hi

    Thank you so much.
    If you talk a little bit PHP, more than WP, you can add these lines to get the content you want :

    Assumed, you're in the loop :

    $event=$EventPost->retreive();
    echo $event->start.' '.$event->end;

    If you prefere timestamp values to do what you want :

    $event=$EventPost->retreive();
    echo $event->time_start.' '.$event->time_end;

    For a specific event, the function can be called with a parameter :
    $event=$EventPost->retreive($post);
    where $post can be an integer or an object.

    Hope it helps !

  3. Samuel RM
    Member
    Posted 1 year ago #

    Great, it works fine!
    Many thanks!

  4. Bastien Ho
    Member
    Plugin Author

    Posted 1 year ago #

    You're welcome

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Event post
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic