Support

Home Forums Event Espresso Premium Ajax Notices before opening HTML tag

Ajax Notices before opening HTML tag

Posted: March 10, 2018 at 12:14 am


raffy

March 10, 2018 at 12:14 am

This is with reference to: https://eventespresso.com/topic/ajax-notices-before-and-using-fhee__ee_front_controller__display_errors/#post-255350

Your last instruction with regard to troubleshooting was:

If your getting output before the HTML tags it’s usually a good indication that the theme or a plugin is running the loop before its expected.

Other things I found out since then:

  • problem does not seem to be there with other themes. I use a theme from rockettheme.com that gantry5/twig/timber.
  • event list and venue list are not affected. All other pages are affected.
  • I can’t get my WordPress to write a debug.log file

Any additional tips you can provide?


Josh

  • Support Staff

March 12, 2018 at 8:18 am

Hi Raffy,

While I can’t guarantee this will work with the “gantry5/twig/timber” because that theme does not follow WP coding standards, you can try adding this code to a site-specific plugin and it may help:

function move_ee_notices_to_main_loop() {
    add_filter('FHEE__EE_Front_Controller__display_errors', '__return_true');
    return false;
}
function remove_ee_notices_from_early_loop() {
    if(!did_action('wp_head')) {
        add_filter(
            'FHEE__EE_Front_Controller__display_errors', 
            'move_ee_notices_to_main_loop'
        );
    }
}
add_action('loop_start', 'remove_ee_notices_from_early_loop', 2);

You can add the above code to a functions plugin.


raffy

March 12, 2018 at 7:46 pm

Hi, Josh!

Thank you for giving that a go.

I created a site-specific plugin with your code.

I am sorry to report that it did not work.

To clarify, the primary reason why I need to clean up that part of the HTML is that I cannot create proper social cards for FB and twitter. I wanted the event pages to be used for that but the problem prevents the FB scrapers from reading the page properly.

My workaround is to create a site that does not have the HTML output problem just for landing pages then redirect them to the appropriate part of the site.

I’ll try to get someone at rockettheme.com to deal with it.

The support post ‘Ajax Notices before opening HTML tag’ 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  raffy 6 months, 2 weeks ago ago

Topic Tags

Notifications

This topic is:
pending
Do NOT follow this link or you will be banned from the site!