• Hi All,

    Building a custom single-event.php page. How do you go about pulling in the time field from the plugin.

    Tried lots of diffrent ways – but all pulls in Today’s date not the set time on event.

    Any help will be much appriacted.

       $start_date_timestamp = !empty( $start_date_timestamp ) ? $start_date_timestamp : $today;
       $end_date_timestamp = !empty( $end_date_timestamp ) ? $end_date_timestamp : $today;
    
       echo $start_time = date( 'Hi', intval($start_date_timestamp) );
       echo $end_time = date( 'Hi', intval($end_date_timestamp) );
    
    
       $middle = strtotime($end_time);           
       $new_date = date('Y-m-d H:i:s', $middle);
    
       echo $new_date;
    

Viewing 1 replies (of 1 total)
  • Plugin Author Guido

    (@guido07111975)

    Hi,

    You must call get_post_meta() first in your single event file:

    $start_date_timestamp?=?get_post_meta(?get_the_ID(),?'event-start-date',?true?);
    $end_date_timestamp?=?get_post_meta(?get_the_ID(),?'event-date',?true?);

    Guido

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Single-event page – Time Field’ is closed to new replies.