Support

Home Forums Ticketing Add-on Ticketing addon breaks custom css

Ticketing addon breaks custom css

Posted: November 15, 2013 at 10:19 am


Christian Shenouda

November 15, 2013 at 10:19 am

Hi,

I am on WordPress 3.7.1, EE 3.1.35.2.P.
There is a problem with the Ticketing Addon. It breaks the css of our commercial theme GoodSpace.
Obviously it is very odd that the ticketing addon would do that, since it’s got nothing to do on the frontend, but I made sure by disabling all other plugins (except EE main plugin) that it is infact the Ticketing addon that’s causing the trouble. I even setup a new WordPress installation with the same result.
What is happening is that the theme has some options like background pattern, font styles, etc. in WordPress’ admin panel which I can setup. Those are loaded from a style-custom.php in the theme’s folder. Now, when the ticketing addon is activated exactly this file will throw a 500 Error. So far I have tracked down the style-custom.php to be called by this line in the theme:
<?php wp_head(); ?>

I am aware of these 2 forum posts (https://eventespresso.com/topic/event-espresso-ticketing-plugin-breaking-theme-css/ and https://eventespresso.com/topic/activating-ticketing-addon-messes-up-css/) but they did not help. But it shows me that I’m not the only one with this strange problem!

Please, any help is appreciated. This has been driving me insane for quite some time now.
Many Thanks,
Chris


Josh

  • Support Staff

November 15, 2013 at 11:37 am

Hi Chris,

We’d need to see the theme code in order to troubleshoot this. Can you send a copy of the theme to support at eventespresso.com?


Christian Shenouda

November 15, 2013 at 11:41 am

Of course, just sent it.


Josh

  • Support Staff

November 15, 2013 at 1:45 pm

Hi Christian,

I looked through the theme code and as far as can tell the trouble starts from within the style-custom.php file itself. If you look on line 16 it’s loading up WordPress:

require_once($wp_content . 'wp-load.php');

So WordPress itself is loading up a second time. This sets off a chain reaction where plugins that expect WordPress to be loaded up once (like the ticketing add-on) start doing unexpected things. There’s probably a better way to make a custom stylesheet that doesn’t involve bootstrapping WordPress core (it’s already loaded, so now things are loading up twice and fatal errors are being thrown).

One way to deal with the specific issue with the ticketing add-on is change one line of code where the ticketing add-on requires its functions.php file. If you open up espresso-ticketing.php and change line 69 to read:

require_once(ESPRESSO_TICKETING_FULL_PATH . 'functions.php');

that should help.

Normally the full path isn’t required and doesn’t cause issues to require the funcitons.php file by its relative path.

However, since WP is getting bootstrapped twice you may find that when you install other plugins that have their own functions.php file you will need to apply a similar change.


Christian Shenouda

November 15, 2013 at 7:10 pm

Worked like a charm! Thanks a lot.

The support post ‘Ticketing addon breaks custom css’ 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