Support

Home Forums Event Espresso Premium Template issues

Template issues

Posted: May 19, 2022 at 2:28 pm

Viewing 12 reply threads


mobloggy

May 19, 2022 at 2:28 pm

The template is displaying Event information twice once at the very top and then again below the Event title.

The other issue is the event list is displaying expired events even though we have the option to hide expired events turned on

https://bcpoa.com/events/bcpoa-summer-social-2022/


Sam

  • Support Staff

May 20, 2022 at 6:34 am

Hi Chris,

Are you using Avada layout templates?

In short, Event Espresso hooks into the_content to inject the event details into the page and we recently had another report of issues with Avada doing the same thing when using the layout editor. Turns out Avada runs the_content multiple times so EE injects the event details multiple times and the above happens.

We have a snippet you can use to hook into Avada and prevent that from happening:
https://gist.github.com/Pebblo/bb0c36c05392a3b91ea1c635fcaa794d

You can add that to a custom functions plugin on your site, we have some documentation on creating one here: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

With that on the site does it work as expected then?


mobloggy

May 20, 2022 at 10:24 am

Yes, We are using Avada. Will this fix the issue about hiding expired events?


mobloggy

May 20, 2022 at 10:39 am

Thanks for the help. I was able to put that code into the function.php of the Avada Child Theme. The Remain issue is the

https://bcpoa.com/events/

It is showing the most recent event details where the header should be and even though I have the option turned on it is showing expired events.


Joao Victor

  • Support Staff

May 24, 2022 at 6:17 pm

Hi Chris!

Thanks for getting back to us.

In order to take a look at your website, could you please share your temporary WordPress credentials following this link?
https://eventespresso.com/send-login-details/

I am waiting for your comment on this!


Tony

  • Support Staff

May 24, 2022 at 9:55 pm

Hi there,

It looks like your are using the Avada Templates feature on both the Single output and the Archives (I’m guessing you are using it sitewide).

I’ve included some code in my gist above so that it should not also remove the even output from archives:

https://gist.github.com/Pebblo/bb0c36c05392a3b91ea1c635fcaa794d

Try replacing the code you currently have with the above, does that fix the /events/ output?


mobloggy

May 25, 2022 at 12:01 pm

After playing around with both codes you provided I found that Lines 3-15 of the code in the link below:

https://gist.github.com/Pebblo/bb0c36c05392a3b91ea1c635fcaa794d

fixes the header issue on both the:

https://bcpoa.com/events/bcpoa-summer-social-2022/
https://bcpoa.com/events/

It also removes the ticket selector on individual events page. I can add the ticket selector as a shortcode but by doing that it causes the calendar tooltip to break the Avada layout. I turned the tooltip off for now.

If I add lines 17-29 it adds the ticket selector and event details multiple times at the top of the page. I don’t currently have 17-29 in the child theme.

The remaining issue is Expired Events

When I added the code

https://gist.github.com/Pebblo/bb0c36c05392a3b91ea1c635fcaa794d

it did not do anything. Under the Events > Templates Tab I have the setting

Show Expired Events – “No”

yet expired events are still visible on https://bcpoa.com/events/

I will add login credentials in a private message.


mobloggy

May 25, 2022 at 12:10 pm

This reply has been marked as private.


Tony

  • Support Staff

May 25, 2022 at 12:18 pm

It also removes the ticket selector on individual events page.

Sure, it will do because that’s what those lines do.

Lines 17-29 re-add the call to add the event details into the content, so without those EE won’t automatically inject the event details back in.

To explain a little, EE hooks into the call to the_content and injects the event details into that. It is expected that the_content is only called once on a page to output the details but with Avada doing what it does not it calls the_content multiple times.

They have a hook within the function so they can add exceptions for things like the above and to allow plugins to hook into that process and remove functions, before the_content call, then re-add them afterwards again, which is what my function does.

If I add lines 17-29 it adds the ticket selector and event details multiple times at the top of the page. I don’t currently have 17-29 in the child theme.

Is that on the single event output?

When I added the code

https://gist.github.com/Pebblo/bb0c36c05392a3b91ea1c635fcaa794d

it did not do anything.

That’s the same function for removing/re-adding the functions mentioned above?

Did you mean to add another function?


mobloggy

May 25, 2022 at 12:25 pm

If I add lines 17-29 it adds the ticket selector and event details multiple times at the top of the page. I don’t currently have 17-29 in the child theme.

This is in regards to an individual event page


Tony

  • Support Staff

May 25, 2022 at 12:48 pm

This is in regards to an individual event page

Actually, I could do with some conditional’s in that code as it will be adding the filters twice.

Try the above code in full, but remove lines 24-28.

What happens then?


mobloggy

May 25, 2022 at 12:49 pm

When I have the full code in

Use Custom Display Order – No

https://paste.pics/fc21db40a4ab5cc1d62adf687d85fe65

Use Custom Display Order – Yes

https://paste.pics/8daddebc32528f7efe3d51bb2ab8d692


mobloggy

May 25, 2022 at 12:53 pm

removing lines 24-28 fixed the issue

Viewing 12 reply threads

The support post ‘Template issues’ 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