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; ?>

    Thread Starter ixinho

    (@ixinho)

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

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

    Thread Starter ixinho

    (@ixinho)

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

    Thread Starter ixinho

    (@ixinho)

    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: https://event-post.com/docs/)

    quickly:

    the_date_end()
    the_date_start()
    the_dates()

    Thread Starter ixinho

    (@ixinho)

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

    Thread Starter ixinho

    (@ixinho)

    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 7 years, 5 months 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)
  • The topic ‘Start-date in the post title?’ is closed to new replies.