Support

Home Forums Event Espresso Premium Adding Venue shortcode gives all venues instead of according Venue

Adding Venue shortcode gives all venues instead of according Venue

Posted: August 28, 2013 at 9:34 am

Viewing 9 reply threads


Raymond Soerodikromo

August 28, 2013 at 9:34 am

Hi Guys,

When I use the shortcode given for venue. I get all the venues instead of only the venue according to the event. Am I missing something.

The code used
<?php echo do_shortcode(‘
[ESPRESSO_VENUE event_id=”‘.$event->id.'”
show_image=false
show_description=false
show_address=false
show_additional_details=false
show_google_map_link=false
show_map_image=false]
‘);?>

Thanks in advance,
Ray


Josh

  • Support Staff

August 28, 2013 at 12:06 pm

Depending on where you’re trying to use this code, event->id may or may not be a defined variable. You can verify this by looking at the template code. I know in some of the templates the variable for the event ID is event_id.


Raymond Soerodikromo

August 30, 2013 at 3:42 am

Hi Josh,

Thanks for your answer. Looking at the code I only need to put ID in capital.
But that does not work either. Am I missing something?

Here is the code:

$post_type = get_post_meta( $post->ID, ‘_single_post_type’, true );


Dean

August 30, 2013 at 4:00 am

Hello Raymond,

That code is not related to the venue shortcode. The venue shortcode you provided should work, though you need to make sure it is all on one line.

The get_post_meta will not work in an event, it isnt a true post type, so that may be why it isn’t working for you.


Raymond Soerodikromo

August 30, 2013 at 4:15 am

Hi Dean,

Thanks for the feedback.
Looking at Josh’s reply I changed the code to below. But is still gives all the events instead of the according event.

ESPRESSO_VENUE event_id=”‘.$event_id->ID.'”

What do I need to check to get it working?

Thanks in advance!
Raymond


Dean

August 30, 2013 at 4:19 am

$event_id is not a valid variable/array. it is $event.

Can you clarify what you are trying to do please? And in what file/s?

Thanks


Raymond Soerodikromo

August 30, 2013 at 4:31 am

Hi Dean,

Thanks. I’m trying to show up the venue details with the event.
With the following below I get all the venues displayed instead of just the one belonging to the event. An example of the page is here where you will find the venues below the post:
http://bouwevents.nl/ecobouw-2013/

This is the code I used:
<?php echo do_shortcode(‘
[ESPRESSO_VENUE event_id=”‘.$event->ID.'”
show_image=true
show_description=false
show_address=true
show_additional_details=false
show_google_map_link=true
show_map_image=false]
‘);?>


Dean

August 30, 2013 at 5:13 am

Hi,

OK, well it looks like what you linked is a Post rather than the event.

If so, if an event has a venue attached to it, the Post should automatically show the address, so there is no need for the additional code.

To show the venue in the event registration page, of the actual event http://bouwevents.nl/event-registration/?ee=2, you would just need to allocate a venue to the event and make sure that in the Template settings “Display the address in the registration form?” is set to Yes.

I would suggest removing the code temporarily and making sure there isnt any additional Venue shortcodes in the event description and update the event, making sure that the “Add/Update post for this event?” at the bottom of the event editor is set to yes.


Raymond Soerodikromo

August 30, 2013 at 6:14 am

Hi Dean,

Thanks, I changed it as you mentioned.

But how do I go about if I want to mention the venue(name) in the event (and eventually in the post) as well ?

I would like to give the visitors the opportunity to go to venue(details/description) from within the event. And from that venue page see all the events taken place there.

The reason I use post is that I can display them in a nice (blog) way.

Thanks in advance!
Raymond


Josh

  • Support Staff

August 30, 2013 at 7:40 am

Hi Raymond,

If you’re working with the event_post.php template, then you can use $event_id as it’s defined starting on line 6. So your Venue shortcode would look like:

<?php echo do_shortcode('
[ESPRESSO_VENUE event_id="'.$event_ID.'" show_description=false show_additional_details=false show_map_image=false]');?>

Note that you don’t need to include any parameters that you want returned as true, they are true by default.

Viewing 9 reply threads

The support post ‘Adding Venue shortcode gives all venues instead of according Venue’ 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