Posted: August 12, 2014 at 5:51 am
|
Here is my single archive file. Notice at the bottom I have the venue tag. It is not pulling in the values. Can you help. <?php get_header(); ?> </div> |
Hi Stephen, It turns out that espresso_event_venues() requires the Venue View helper. So you can add the following to your event template to load it:
There is more info here: https://eventespresso.com/wiki/ee4-themes-templates/#venue-view |
|
|
Josh I have included the instance. still nothing: <?php get_header(); ?> </div> |
Are you loading the events via the loop template or from another template part? |
|
|
I have it under the loop section do you recommend putting it somewhere else. |
|
Do you have an example of that section so I can see what I am doing wrong. Thanks |
What I mean is, it looks like you’re trying to load up the venue information outside of the loop. So in this case it may help to move your template tag into the loop. |
|
|
Josh, |
Hi Stephen, Can you let me know exactly what Venue information you are trying to display so I can work up an example? As an aside, can you share the link to the WP codex article that you are using? It might help to know that an event post isn’t the same thing as a regular WP post, and using one of Event Espresso’s template tag that’s dependent on a helper method isn’t something you’d likely find in the WP codex. |
|
|
I would like to show all details. I then can learn how to do other parameters. The codex I am using is http://codex.wordpress.org/Templates and http://codex.wordpress.org/The_Loop |
Hi Stephen, I’d also recommend the Post Type Templates article in the codex: http://codex.wordpress.org/Post_Type_Templates Note that your single event template needs to be named single-espresso_events.php Along with that, you might find it to be easier to use the other Venue template tags, like espresso_venue_name() and espresso_venue_address() but here’s an example of how to use the espresso_event_venues() tag to get the event name, address, city, and state: //Get the venue for this event $venues = espresso_event_venues(); $venue = array_shift( $venues ); if ( $venue instanceof EE_Venue ) { $venue_name = $venue->name(); $venue_address = $venue->address(); $venue_city = $venue->city(); if ($venue->state_obj() instanceof EE_State ) { $state = $venue->state_obj()->name(); } } else { $venue_name = ''; $venue_address = ''; $venue_city = ''; $state = ''; } // then echo the above variables into your html |
|
|
THanks I will give it a shot. Do you know if there are any shortcodes for the venues in ee4? |
Hi Stephen, As of today (August 14, 2014) Event Espresso 4 does not have shortcodes for venues. There are a number of template tags that can be used within a template though. They are listed in this document: https://eventespresso.com/wiki/ee4-themes-templates/#venue-view |
|
|
Josh, |
Hi Stephen, I can recommend looking at the built in templates that Event Espresso 4 includes. You’ll want to review single-espresso_events.php and content-espresso_events.php along with the template parts that are called. All of the included template files can be found in the /templates/Espresso_Arabica_2014 folder. If you require the services of a developer, we have a page that lists out recommended developers: |
|
|
Still working on this I need to learn. So I used the sample template and have made the adjustments to make it work in my theme. My question is how do I put the event description up top and the ticket option at the bottom in the template and how do I get rid of the second set of class information being shown. One looks short the other longer. // Start the Loop. |
Hi Stephen, In the last line of code that you posted above, it’s giving an instruction to load up the content-espresso_events.php template part. You’ll find that if you open up content-espresso_events.php in a text editor, remove or move around the calls to the different template parts, then save, it will change what you see on the event page. You’ll also see that the first part handles the Single event view ( everything after if (is_single() ) : ) and the second part handles the archive view ( after elseif (is_archive() ) : ) This allows for different layouts and content in each of the two views. |
|
|
Ok I got it working almost the way IO want it just a few more tweaks. Thanks Josh. The only thing that is strange is the venue display is not working and when I look at the called file it references EE3. |
Hi Stephen, Did you include the venue view helper? Can you let me know what file references Event Espresso 3? |
|
|
I was wrong it listed it as H3 not EE3. I am trying to edit the single venue view. I have made changes in the content-espresso_venues.php but nothing happens the same page I started with without changes appears. Is this the wrong file to edit to make changes to the single venue view? |
|
Josh figured it out and moved the single venue file over. Things are coming together lol. |
The support post ‘Single Event Template Question’ 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.