Support

Home Forums Event Espresso Premium Event Espresso is breaking my theme's masonry layout

Event Espresso is breaking my theme's masonry layout

Posted: April 25, 2021 at 12:58 pm


jbroner

April 25, 2021 at 12:58 pm

The Event Espresso plugin loads a JS resource file that created a conflict with the masonry builder. The plugin also injects custom content on the blog index which is not supposed to. The plugin should only insert contents to pages related to the plugin and not to the whole site. Can this be looked into? It’s breaking the layout on our site.


Tony

  • Support Staff

April 26, 2021 at 3:44 am

Hi there,

Can you link me to the page I can view this on, please?
(Note you can mark your reply private if you don’t want the link to be publicly viewable)

For the most part, Event Espresso already only loads its content where needed. However, because you can use some of our shortcodes within any location on your site, for example, the [ESPRESSO_TICKET_SELECTOR] shortcode within a post and we have no way of knowing where that will be used we do need to load some content throughout the site.


jbroner

April 26, 2021 at 12:33 pm

This reply has been marked as private.


Tony

  • Support Staff

April 27, 2021 at 2:26 am

The images don’t really help as I already know which div’s EE will be injecting (the ones you highlighted are the only div’s we load on none EE pages) but not how that conflicts with your specific theme. At a guess, I’d say this isn’t a JS conflict but rather CSS in that they are likely using a first-child selector and should be using nth-of-type but without seeing the output on the page it’s just a wild guess based on what other themes have done in the past.

I can give you a snippet that will prevent those EE placeholders from being injected:

add_filter( 'FHEE__EE_Front_Controller__display_errors', '__return_false' );

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/

However, those notices are used to display errors from Event Espresso so rather than removing them from every page I’d recommend excluding them from the outputs that run into problems but will need more details on the outputs affected to give an example.


jbroner

April 27, 2021 at 12:26 pm

That snippet did indeed fix the masonry problem. It is possible to limit that just to the index page and not effect errors on the event pages?


Tony

  • Support Staff

April 27, 2021 at 2:58 pm

The index page as in home?

If so you can use something like this:

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

Which will disable the above on the home/front page and leave return the filtered value otherwise.


jbroner

April 28, 2021 at 7:35 am

That fixed it – thanks so much!


Tony

  • Support Staff

April 28, 2021 at 12:59 pm

You’re most welcome 🙂

You must be logged in to reply to this support post. Sign In or Register for an Account

Do NOT follow this link or you will be banned from the site!