Support

Home Forums Event Espresso Premium Extra EE code being added to category pages are breaking the theme columns

Extra EE code being added to category pages are breaking the theme columns

Posted: February 29, 2016 at 10:42 pm


Salvador Alicea

February 29, 2016 at 10:42 pm

Hi there
Event Espresso is adding a bunch of code that is messing up the styling of our theme (Herald theme from themeforest).
The code doesn’t seem to be relevant on these category pages – is there a way I can exclude them for this extraneous code?

eg
https://www.southgatemelbourne.com.au/offers-promotions/
https://www.southgatemelbourne.com.au/news/

<div id=”espresso-notices”/>
<div id=”espresso-ajax-loading” style=”display: none;”>
<div id=”espresso-ajax-notices”>

and…

Following other post in the forum I already exclude the eeror notice code using this


add_filter( 'FHEE__EE_Front_Controller__display_errors', 'ee_remove_notices_from_front_page' );
function ee_remove_notices_from_front_page($display_errors) {
if( is_category( ) ) {
$display_errors = false;
}

return $display_errors;
}

however I am not be able to eliminate the checkout style that is the one that is breaking the theme style.
I already try this but it does not work..

add_action('template_redirect', 'ee_remove_cart_markup');
function ee_remove_cart_markup(){
if( is_category( ) ) {
remove_action( 'loop_start', array( 'EED_Single_Page_Checkout', 'set_checkout_anchor' ), 1 );
}

Can you help me figure out a solution. EE is vital for me.


Salvador Alicea

February 29, 2016 at 10:46 pm

for better view of the code


add_filter( 'FHEE__EE_Front_Controller__display_errors', 'ee_remove_notices_from_front_page' );
function ee_remove_notices_from_front_page($display_errors) {
	if( is_category( ) ) {
		$display_errors = false;
	}		

	return $display_errors;
}

and


add_action('template_redirect', 'ee_remove_cart_markup');
function ee_remove_cart_markup(){
    if( is_category( ) ) {
        remove_action( 'loop_start', array( 'EED_Single_Page_Checkout', 'set_checkout_anchor' ), 1 );
    }


Josh

  • Support Staff

March 1, 2016 at 8:29 am

Hi Salvadore,

It may help to know exactly what in the layout is broken when a few empty divs are added to the page. It’s likely there’s a style rule that’s counting the number of divs or child elements, and would be better tweaked to not rely on a set number of elements to target the right selectors.


Salvador Alicea

March 1, 2016 at 12:34 pm

Josh. Thank you for your response.
I think the best way to allow you to see the broken layout and help me with it is giving you direct access to my wordpress. Can you let me know to what email I can send you a user and password?


Josh

  • Support Staff

March 1, 2016 at 3:53 pm

No emails please. You can send those details over a secure form and someone can take a look at your site and possibly offer a suggestion on how to fix your theme.

https://eventespresso.com/send-login-details/


Salvador Alicea

March 1, 2016 at 4:42 pm

Josh, I sent you by secure form the info.


Salvador Alicea

March 1, 2016 at 6:50 pm

Josh, A summary of what I have done so far… (working hard on non working hours 🙂 )

1. I discarded the “style rule that’s counting the number of divs or child elements” theory. Why? With EE inactive I added some divisions located on the index.php template in positions to render at same location of the checkout_anchor. It didn’t change anything in layout (layout ok).

2. If I change the -999em to 0 or a positive number to the checkout_anchor that solve the breaking error (done thru the chrome develop console). The checkout anchor are moving to the far left the series of posts.

3. Other non permanent solution due to the fact that will change if I upgrade to new version of EE in the future is as follow: If I wrap the checkout_anchor (that actually is just an element ) within <div></div> at your EE function: set_checkout_anchor(). It render in same position with in divisions and with not layout issues. This “solve” the issue.

I hope this give you some light at the end of the tunnel to help me….

Let me know on your time!

Salvador


Lorenzo Orlando Caum

  • Support Staff

March 2, 2016 at 9:14 am

Hi Salvador,

Could you update to the latest version of Event Espresso 4 please?

https://eventespresso.com/wiki/ee4-changelog/

The feedback that we will share will be in testing with the current release.


Lorenzo


Josh

  • Support Staff

March 2, 2016 at 1:17 pm

@Salvaldore,

Can you let us know where the actual breakage is happening on this other site? A URL and a screenshot would be most helpful to know where to start to look.


Salvador Alicea

March 2, 2016 at 3:16 pm

Josh
the images…

FRom this menu you navigate to categories…
menu

You get this page, at the bottom (bellow the title) the post should be
category page

THe checkout_tag breaking the line…
where the code break the layout

After deleting the checkout
Whitout the checkout tag

I am updateing to latest version as Lorenzo requested… I will let you know here.


Salvador Alicea

March 2, 2016 at 3:18 pm

A extra one showing in yellow where the checkout tag is located on page


Tony

  • Support Staff

March 3, 2016 at 3:18 am

Hi Salvador,

A quick fix for this is to add some custom CSS to hide the checkout element, like so:

a#checkout {
    display: none;
}

We recommend using either the My Custom CSS or Reaktiv CSS Builder plugins to add custom styles such as these.

The theme seems to be doing something add that is also causing EE to inject the checkout element multiple times within the page, which theme are you using?


Salvador Alicea

March 3, 2016 at 5:50 am

The theme is Herald from themeeforest.
theme


Tony

  • Support Staff

March 3, 2016 at 6:49 am

Can you send a copy to support[at]eventespresso.com so I can take a look?

Depending on the file size you may need to host the file on something like dropbox and include the link within the email.


Salvador Alicea

March 3, 2016 at 12:15 pm

Hi Tony,
I will prepare a zip file on my server to allow you get a copy.


Josh

  • Support Staff

March 7, 2016 at 3:45 pm

Hi Salvadore,

Here’s the way to programmatically remove that checkout div that you can add to your theme’s functions.php file or into a site specific plugin:

add_action( 'template_redirect', 'ee_remove_cart_markup' );
function ee_remove_cart_markup(){
 if( is_category( ) ) {
  remove_action( 'loop_start', array( EED_Single_Page_Checkout::instance(), 'set_checkout_anchor' ), 1 );
 }
}


Salvador Alicea

March 7, 2016 at 6:46 pm

Josh, Tony, and Lorenzo.
Thank you for all your help and time to resolve this. It is working now as expected.
You developed a great product and your support is outstanding… that make the difference. Great Job!.


Tony

  • Support Staff

March 8, 2016 at 4:48 am

You’re most welcome, Salvador.

Thank you for the feedback, could you share you experience with Event Espresso? We have some examples of how you can do that here:

https://eventespresso.com/about/help-us-help-you-how-to-share-event-espresso/

If not, that’s fine too but either way have a great day 🙂

The support post ‘Extra EE code being added to category pages are breaking the theme columns’ 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