Support

Home Forums Event Espresso Premium adding a custom summary field at end of event page

adding a custom summary field at end of event page

Posted: November 7, 2016 at 11:17 am

Viewing 10 reply threads


Nancy

November 7, 2016 at 11:17 am

Hello, I would like to add terms and conditions text and some other general info to the bottom or each event listing page. I have the page displaying in this order, date times, description, tickets, location. And I would like to put at the bottom, under location a few paragraphs of text. What is the best way to do this?


Seth Shoultes

  • Support Staff

November 7, 2016 at 5:01 pm

You can probably achieve this using the Advanced Custom Fields WordPress plugin and some custom hooks. We published a tutorial on adding a sponsors section that might help:
https://eventespresso.com/wiki/add-sponsors-section-events-using-advanced-custom-fields/


Josh

  • Support Staff

November 7, 2016 at 5:43 pm

The best way depends on the contents of the information. For example is the information going to be the same across all events, or does it need to be unique to the event?


Nancy

November 8, 2016 at 7:51 am

It would be the same info on every event.


Lorenzo Orlando Caum

  • Support Staff

November 8, 2016 at 12:04 pm

Hello,

The following action hook could be used:

AHEE_event_details_after_post

There is a sample function in this support post (https://eventespresso.com/topic/add-default-text-at-bottom-of-each-event/#post-169832). It can be added to a site specific plugin (https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/) and then you can edit the messaging to replace “Some text” with your actual messaging.

Another idea is to use a terms and conditions question during registration checkout which will then become part of each registration record:

https://enzo12.com/training/create-terms-conditions-question-event-espresso/


Lorenzo


Nancy

November 9, 2016 at 10:09 pm

thanks, that action hook worked. It was also adding it beneath each event in the event list but I removed it there with css.


Tony

  • Support Staff

November 10, 2016 at 5:58 am

If you only want the output to be shown on the single event pages you can wrap the output from the function within:

if( is_single() ) {
    //output t&c's
}

That’s should prevent the content from being output on the event lists so you don’t need to hide it.


Nancy

November 10, 2016 at 2:47 pm

Thanks Tony. I don’t really know php. I am just faking it. Would the code be like this?

if( is_single() ) {

function add_some_text($post) {

echo ‘<div><p>Some text</p></div>’;

}
add_action(‘AHEE_event_details_after_post’, ‘add_some_text’);

}


Tony

  • Support Staff

November 10, 2016 at 4:49 pm

Nope, the other way around, like this:

function add_some_text($post) {
    if( is_single() ) {
        echo '<div><p>Some text</p></div>';
    }
}
add_action('AHEE_event_details_after_post', 'add_some_text');

The ‘add_some_text’ function is ‘hooked’ in into the ‘AHEE_event_details_after_post’ hook at the bottom, which basically means run that function when the hook is fired.

So within add_some_text you check if you are on a single page using:

if( is_single() ) { //Something }

Witihin the brackets you do whatever it is you want to do if your on a single post, in this case output some text.

Make sense?


Nancy

November 10, 2016 at 5:08 pm

Yes, it does.

Thanks for the explanation.


Tony

  • Support Staff

November 10, 2016 at 5:20 pm

You’re most welcome 🙂

Viewing 10 reply threads

The support post ‘adding a custom summary field at end of event page’ 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