Support » Plugin: Event post » Start-date in the post title?

  • Resolved ixinho

    (@ixinho)


    Hello is it possible to have start date somehow in the post title ?
    I have a category posts widget on my homepage which displays these posts, and i would like to have an option of letting people know when will the event happen without clicking on the post. . .

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

Viewing 12 replies - 1 through 12 (of 12 total)
  • With this code you get the Event-Date instead of the publication date.

    <?php  $display_date = date('d.m.Y', strtotime(get_post_meta($post->ID, 'event_begin', true)));
    
                             if ( $display_date == '01.01.1970'): { the_time('d.m.Y'); } else: { echo $display_date;  } endif; ?>

    Thank you for the reply. Where should i place the code?

    Depends on your theme. In my case in archive.php

    Hm, but will it replace the date for all post types or only for event posts made with this plugin?

    And shall i use it without php tag if i put it in some php page that already has tags?

    Plugin Author Bastien Ho

    (@bastho)

    Hi

    you can also use in your theme the wrapper functions (listed here: http://event-post.com/docs/)

    quickly:

    the_date_end()
    the_date_start()
    the_dates()

    Thank you. Could you please assist me with that, since i don’t know where and how should i put it ?

    Could i please have some help on having the event date instead of published date for the event-posts ? It’s kinda really urgent to me : /

    Plugin Author Bastien Ho

    (@bastho)

    Has @dombucheli said, you have to manage it in your theme. actually, if you do not touch php, you can’t.

    Hi
    This post has been extremely helpful and the plugin is awesome!

    I need a little more help though. In addition to the event date instead of published date, I’d like to have the start and end times of the event as well.

    Could you extremely clever guys help me out with a line or two of code I can use to add to the date and achieve this?

    I’m very new to php and unable to write the code myself but can find my way around and put it in the right place.

    Many thanks

    Just to make things clearer, here’s the code listed above:

    ` <h3><?php $display_date = date(‘F j, Y’, strtotime(get_post_meta($post->ID,
    ‘event_begin’, true)));
    if ( $display_date == ‘01.01.1970’): { the_time(‘F j, Y’); } else: { echo
    $display_date; } endif; ?></h3>`

    I just need to add start time and end time e.g. June 29, 2017 from 10:00 am to 3:00 pm

    Many thanks again

    • This reply was modified 4 months, 4 weeks ago by  adrianwest.
    Plugin Author Bastien Ho

    (@bastho)

    Hi @adrianwest,

    In order to simply display the current post’s dates, you can use the wrapper function <?php the_dates(); ?>.

    It uses the $EventPost->delta_date() method.

    PS: Thank you 😉

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.