Support

Home Forums Event Espresso Premium Need Help with Address and Location of Code Snippet on Venue Listing

Need Help with Address and Location of Code Snippet on Venue Listing

Posted: February 28, 2019 at 8:56 pm


mcotten

February 28, 2019 at 8:56 pm

I almost have my edited venue template displaying like I want but I’m having trouble with two issues.

1. I’m trying to get the “Address:” label and address information to display on one line.

2. I would like the “upcoming events for a venue” code snippet to display after the venue description but before the Google Map, but I’ve moved the address display above the description. The code snippet in my child theme is set to display “after_the_content”.

Here is the link to my dev site: http://184.154.230.20/~mattcott/btdchicago.com/theaters/american-blues-theater/

Here is my edited content-espresso_venues-details.php:

Any help would be much appreciated.


<?php //echo '<h1>' . __FILE__ . '</h1>'; ?>
<?php global $post; ?>
<div class="venue-content">
<?php if ( apply_filters( 'FHEE__content_espresso_venues_details_template__display_entry_meta', TRUE )): ?>
<div class="entry-meta">
<span class="tags-links"><?php espresso_venue_categories( $post->ID, TRUE, TRUE ); ?></span>
<?php
if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) :
?>
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'event_espresso' ), __( '1 Comment', 'event_espresso' ), __( '% Comments', 'event_espresso' ) ); ?></span>
<?php
endif;

edit_post_link( __( 'Edit', 'event_espresso' ), '<span class="edit-link">', '</span>' );
?>
</div>
<?php endif; ?>

<h2>
<?php the_title(); ?>
</h2>

<?php
do_action( 'AHEE__content_espresso_venues_details_template__before_the_content', $post );
?>

<p>
<?php if ( $venue_phone = espresso_venue_phone( $post->ID, FALSE )) : ?>
<?php _e( 'Phone:', 'event_espresso' ); ?> <?php echo $venue_phone; ?><br>
<?php endif; ?>
<?php if ( $venue_website = espresso_venue_website( $post->ID, FALSE )) : ?>
<?php _e( 'Website:', 'event_espresso' ); ?> <?php echo $venue_website; ?><br>
<?php endif; ?>
<?php if ( espresso_venue_has_address( $post->ID )) : ?>
<?php _e( 'Address:', 'event_espresso' ); ?><?php espresso_venue_address( 'inline', $post->ID ); ?>
<?php endif; ?>
</p>

<?php
if ( is_archive() && has_excerpt( $post->ID )) {
the_excerpt();
} else {
the_content();
}
?>

<?php
do_action( 'AHEE__content_espresso_venues_details_template__after_the_content', $post )
?>

</div>
<!-- .venue-content -->


mcotten

March 1, 2019 at 10:26 am

I was able to achieve the results I wanted but for #1, I was forced to edit EEH_Address.helper.php. However, the changes did not apply when it was copied into my Child Theme. So I had to overwrite the original in the plugins core/helpers folder. Not ideal, as I’ll have to edit it again with any plugin updates.

I hope the Event Espresso Team will consider moving the address format template to public as dealing with address formatting in Event Espresso 4 is a real pain.

For #2, I was able to move the “after_the_content” action to content-espresso_venues-location.php before the Google Map.


Josh

  • Support Staff

March 1, 2019 at 1:19 pm

You do not need to make edits to core code to make the formatting changes.

You could either use CSS:

.venue-location div[itemprop="address"]{
display:inline;
margin-left: 10px;
}

Or if you do not want to use CSS to change the format, you could override the espresso_venue_address function with your own version (it’s a pluggable function, or since you’re already altering the template, just call your own function). Your custom function could be based on the venue address helper method.

The support post ‘Need Help with Address and Location of Code Snippet on Venue Listing’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso