get dates of event with a certain name and use it in a post

Home Forums Calendar Products Events Calendar PRO get dates of event with a certain name and use it in a post

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #968359
    thomas
    Participant

    hi,

    since the pro version has a huge lack in dealing with multiple dates, i have to add a new entry for a new date (because the dates aren’t recurring) – in fact i have switched back to the free version because of that.

    i use a post to book the events. how can i read the dates of an event and show it in the post template.
    i have this example:
    there is a post called “wine”. in the calendar there are multiple dates with the name “wineworkshop” (15 single events over the year).
    i like to get the dates from “wineworkshop” and include it in the page template via php.

    i know there is a function display_day but i dont’t know how to use it.
    thanks in advance
    thomas

    #968539
    Nico
    Member

    Hi Thomas,

    Thanks for hitting the forums – I’ll try to help you on this.

    The simpler way to embed Events in Posts is using Event Rocket. This handy plugin allows you to include events via shortcode directly from the post editor. There are a bunch of parameter you can add and combine, take a look at the complete list. For example:


    // embed all events tagged wine
    [event_embed tag="wine"]
    // embed all events tagged wine & taking place at 'some-bar' venue
    [event_embed tags="wine" venue="some-bar"]
    // embed specific events by ID
    [event_embed event="wineworkshop-1,wineworkshop-2"]

    If you need to get those in the page template, check how to do so here.

    Please let me know how this goes,
    Best,
    Nico

    #968637
    thomas
    Participant

    hey nico,

    this is a great plugin. i achieved what i want by the following lines:
    <?php $slug = basename(get_permalink()); ?>
    <?php echo do_shortcode('[event_embed tag="'.$slug.'"]</br>{start_date}[/event_embed]');?>

    this will read the post slug (=permalink without domain) and put out every date of events that contain the slud as a tag.

    cooler would be to check if the post title is identical to the event title (my posts and events title events are identical) but somehow this is not possible by the plugin (i never get all the events except only one).

    now i only need to echo “fully booked” if in the admin area the checkbox “highlight event in calendar view” is ticked.
    maybe you can help me with that i don’t know how to grab this element.
    regards
    thomas

    #968714
    thomas
    Participant

    hey nico i just found out that the plugin author recommend stop using the plugin:
    https://wordpress.org/support/topic/using-the-event_rocket_calendar-shortcode-read-this

    i think this will stop the support for upcoming versions of theeventscalendar. just to let you know.

    #968813
    Nico
    Member

    Hi Thomas,

    Great that worked for you 🙂

    Thanks for pointing that out! In fact what I suggested is possible without Events Rocket, using [tribe_mini_calendar] instead of [event_embed]. Shame on me! You can check this article in our knowledge base about shortcodes in PRO. Upcoming release 3.10 of The Events Calendar -coming out next week- supports shortcodes as well.

    Please open up a new thread for the ‘fully booked’ issue and we’ll be happy to help you with that as well – we try to keep one issue per thread. I’m closing this one as you original problem was solved!

    Best,
    Nico

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘get dates of event with a certain name and use it in a post’ is closed to new replies.