Topic end time and venue address

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 10 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12703

    I think I’ve asked this before, but can’t see a way to search the forum for a USER (did I miss it?) so can’t find the topic. I did find an identical question in the forum, so I’m referencing that instead.

    I would like to add the end time to the events in my calendar as well as adding a venue address. (Unclear why these aren’t the default, as those are critical elements of every event: date:time:place.)

    Following the details you gave here, I think I did what was suggested without success.

    I opened event-meta-event-single.php and added this per the github image.

    //If not a all day event but it ends on the same day
    if( !eo_is_all_day() && eo_get_the_start( 'Ymd' ) =  eo_get_the_end( 'Ymd' ) ){
      //Display end time:
       eo_the_end( 'g:ia' );
    }

    In the same file, I tried adding the following code per the associated github page:

     $address = array_filter( eo_get_venue_address() );
     echo implode( ", ", $address );

    Both resulted in the code itself appearing on each event page right below the start date (in the first case) and the venue line item (in the second case).

    It appears I’m finding the correct location, but have some problem with the code itself or how to enter it. HTML and CSS I’m good at, but PHP not!

    Thanks for your assistance.

    AlphaSmith
    #12712

    You need to ensure any code you enter is wrapped inside <?php .... ?>. E.g:

    <?php
    //If not a all day event but it ends on the same day
    if( !eo_is_all_day() && eo_get_the_start( 'Ymd' ) =  eo_get_the_end( 'Ymd' ) ){
      //Display end time:
       eo_the_end( 'g:ia' );
    }
    
    $address = array_filter( eo_get_venue_address() );
     echo implode( ", ", $address );
    ?>

    If the code itself is appearing then it’s not been placed inside the php tags.

    As an aside, what you don’t want to do is nest is php tags.:

       <?php
          <?php
              ...
          ?>
       ?>
    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.