Support

Home Forums Event Espresso Premium Venue Title in custom templates

Venue Title in custom templates

Posted: August 7, 2014 at 4:32 pm

Viewing 7 reply threads


Joshua

August 7, 2014 at 4:32 pm

In the template widgets.php i want to add venue_title to my list.

I’ve tried this: <?php echo $event->venue_title; ?> but that didn’t work. What do I have to do for this to work?

– Josh


Lorenzo Orlando Caum

  • Support Staff

August 7, 2014 at 8:50 pm

Hi Joshua,

Please see this link:

https://eventespresso.com/topic/add-venue-title-to-widget-output/#post-38578

Then go to this one:

https://eventespresso.com/topic/add-venue-title-to-widget-output/#post-38582


Lorenzo


Tony

  • Support Staff

August 27, 2014 at 9:33 am

Just to confirm, are you using EE3?

If so the links Lorenzo provided will allow you to include the venue-title.

You’ll need to add the code provided within the pastebin and then you can use something like

echo $event->venue_name;


Joshua

August 27, 2014 at 12:30 pm

Hi Tony,

That’s the problem I don’t quite get what to do with the links provided. Can you explain what needs to be done?


Tony

  • Support Staff

August 27, 2014 at 1:31 pm

I’ve added the code to the widget.php file on my install – http://take.ms/GfqTR
Place that file in wp-content/uploads/espresso/templates/ to keep it update safe.

You’ll need to add

venue_name ; ?>

Wherever you would like to output the venue name in the widget.

Hope that helps.


Joshua

August 27, 2014 at 4:31 pm

Thanks that works great, only thing is that special characters like ‘ get slashed out.

What needs to be like this: ‘t
Get’s rendered like this: \’t


Josh

  • Support Staff

August 27, 2014 at 5:10 pm

Hi Joshua,

This can be fixed by adding the PHP stripslashes function to the code, like this:

<?php echo stripslashes( $event->venue_name ) ; ?>


Joshua

August 28, 2014 at 2:30 am

Ok thanks Josh 🙂

Viewing 7 reply threads

The support post ‘Venue Title in custom templates’ 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