Support

Home Forums Event Espresso Premium Show venue in ESPRESSO_EVENTS shortcode

Show venue in ESPRESSO_EVENTS shortcode

Posted: March 5, 2014 at 3:22 am


Leonardo Angelini

March 5, 2014 at 3:22 am

I use Ee4.
I’m updating content-espresso_events.php for my template.
I need to show the datetime and the venue name in the events list.
If I use espresso_events-tickets, venue name is shown.

<code>&lt;?php espresso_get_template_part( &#039;content&#039;, &#039;espresso_events-tickets&#039; ); ?&gt;
&lt;?php espresso_get_template_part( &#039;content&#039;, &#039;espresso_events-datetimes&#039; ); ?&gt;
&lt;?php espresso_get_template_part( &#039;content&#039;, &#039;espresso_events-venues&#039; ); ?&gt;
&lt;?php espresso_get_template_part( &#039;content&#039;, &#039;espresso_venue_name&#039; ); ?&gt;</code>

If I don’t use espresso_events-tickets, venue name isn’t shown. Why?

<code>&lt;?php // espresso_get_template_part( &#039;content&#039;, &#039;espresso_events-tickets&#039; ); ?&gt;
&lt;?php espresso_get_template_part( &#039;content&#039;, &#039;espresso_events-datetimes&#039; ); ?&gt;
&lt;?php espresso_get_template_part( &#039;content&#039;, &#039;espresso_events-venues&#039; ); ?&gt;
&lt;?php espresso_get_template_part( &#039;content&#039;, &#039;espresso_venue_name&#039; ); ?&gt;</code>

I need to hide the espresso_events-tickets and show the espresso_venue_name.

Can you help me?


Dean

March 5, 2014 at 3:56 am

Hi,

What version of EE4 are you using please? And have you removed the espresso_events-details code already? It seems to be missing.


Leonardo Angelini

March 5, 2014 at 7:14 am

Hi,
I’m using Event Espresso 4 Core Regular v4.1.8.reg and I customized the file content-espresso_events.php (I copied it in my theme directory).

<pre class=”brush: php; gutter: true; first-line: 1; highlight: []; html-script: false”>
<?php
/**
* This template will display a single event – copy it to your theme folder
*
* @ package Event Espresso
* @ author Seth Shoultes
* @ copyright (c) 2008-2013 Event Espresso All Rights Reserved.
* @ license https://eventespresso.com/support/terms-conditions/ * see Plugin Licensing *
* @ link http://www.eventespresso.com
* @ version 4+
*/

global $post;
$event_class = has_excerpt( $post->ID ) ? ' has-excerpt' : '';
$event_class = apply_filters( 'FHEE__content_espresso_events__event_class', $event_class );

?>
<?php do_action( 'AHEE_event_details_before_post', $post ); ?>
<article id="post-<?php the_ID(); ?>" class="item-list">
<div id="espresso-event-header-dv" class="">
<?php do_action( 'AHEE_event_details_before_featured_img', $post ); ?>
<?php
if ( has_post_thumbnail( $post->ID )) :
if ( $img_ID = get_post_thumbnail_id( $post->ID )) :
if ( $featured_img = wp_get_attachment_image_src( $img_ID, 'small' )) :
$caption = esc_attr( get_post( get_post( $img_ID ))->post_excerpt );
$event_class .= ' has-img';
?>

<div class="post-thumbnail">
< a href=""<?php">" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
<?php the_post_thumbnail( 'tie-small' ); ?>
<?php tie_get_score( true ); ?>

</div>
<?php
endif;
endif;
endif;
?>
<?php do_action( 'AHEE_event_details_after_featured_img', $post );?>

<div class="event-header<?php echo $event_class;?>">
<h4 id="event-details-h1" class="entry-title">
< a href=""<?php">"><?php the_title(); ?>
</h4>
<?php if (has_excerpt( $post->ID )): the_excerpt(); endif;?>

</div>
</div>

<div class="espresso-event-wrapper-dv">
<div class="prenota-link">
< a href=""<?php">" class="more-link">Dettagli e prenota
</div>
<?php // echo "—>" + espresso_display_venue_address_in_event_details(); //espresso_get_template_part( 'content', 'espresso_events-details' ); ?>
<?php //espresso_get_template_part( 'content', 'espresso_events-tickets' ); ?>
<?php espresso_get_template_part( 'content', 'espresso_events-datetimes' ); ?>
<?php espresso_get_template_part( 'content', 'espresso_events-venues' ); ?>
<?php espresso_get_template_part( 'content', 'espresso_venue_name' ); ?>
</div>
<div class="clear" />
</article>
<!– #post –>
<?php do_action( 'AHEE_event_details_after_post', $post );

espresso_events-venues and espresso_venue_name don’t work if I disable espresso_events-tickets


Josh

  • Support Staff

March 5, 2014 at 3:32 pm

Hi there,

espresso_venue_name shouldn’t work either way, except unless you have made an espresso_venue_name template and uploaded it to your theme.


Leonardo Angelini

March 5, 2014 at 3:42 pm

Yes, I copied this file content-espresso_events-venues.php in my theme dir.
Do I need to copy other files in my theme directory?


Josh

  • Support Staff

March 5, 2014 at 6:57 pm

Not necessarily. But either way espresso_venue_name isn’t a template part, it’s a template tag. So it’s used like this:

<?php espresso_venue_name(); ?>

The support post ‘Show venue in ESPRESSO_EVENTS shortcode’ 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