Support

Home Forums Event Espresso Premium Adding a background image to the heading on Event registration page

Adding a background image to the heading on Event registration page

Posted: May 29, 2019 at 2:27 pm

Viewing 9 reply threads


Porter

May 29, 2019 at 2:27 pm

I was wondering if the following is possible….

We’d like to add an background image to the Event Title on the registration page. Ideally we’d like different images for each event category.


Porter

May 29, 2019 at 2:29 pm

This reply has been marked as private.


Josh

  • Support Staff

May 29, 2019 at 2:44 pm

Hi,

It should be possible. May I ask how is it that you add the background image to the page in your example? You might also be able to add an image to the event page too by adding some custom code to the WordPress theme.


Porter

May 29, 2019 at 4:33 pm

Thanks Josh – I’ve mananged to work this out by adding code to the Event Description section and hiding the page-title. However, this leads me on to another question. How can I add another section below the Trainer? We’d like to add more information about the course but want it to appear below the trainer section.


Porter

May 29, 2019 at 4:34 pm

This reply has been marked as private.


Josh

  • Support Staff

May 29, 2019 at 5:03 pm

You could add more information there by using the custom fields. Here’s a screenshot that shows an example of how to add a custom field in the event editor:

https://slack-files.com/T02SY781D-FJSCJADGT-00a610c21c

Then, to add the content of that custom field, foo, to the page after the trainer section, you’ll add some code like this to a functions file:

add_action(
    'AHEE_event_details_after_post',
    'my_custom_event_content_after_post',
    10,
    1
);
function my_custom_event_content_after_post($post) {
    if($post->foo) {
        echo '<div class="extra">' . esc_html($post->foo) . '</div>';
    }
}


Porter

May 29, 2019 at 5:22 pm

Thank you – I’ve managed to get that to work. Is there anyway to add code rather than just text to this custom field?


Josh

  • Support Staff

May 29, 2019 at 5:38 pm

I’m not sure I follow. Do you want to display code snippets there or something?


Porter

May 29, 2019 at 6:00 pm

This reply has been marked as private.


Josh

  • Support Staff

May 29, 2019 at 6:20 pm

You can remove
echo '<div class="extra">' . esc_html($post->foo) . '</div>'
and replace with whatever code you want there. The content from the custom field is the $post->foo and ideally that should be escaped just like in the example.

Viewing 9 reply threads

The support post ‘Adding a background image to the heading on Event registration 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