Skip to content

All JavaScript and Editus Break When jQuery Loaded in Footer. #120

@davidrichied

Description

@davidrichied

With Editus, every time I visit a page, a popup with some information about getting started pops up, but because of the bug, I cannot click "Okay, Got It". Since I can't click "Okay, Got It", ticking "Don't show me again" doesn't do anything, and the popup ends up popping up on every single page and every single refresh.

EDIT:

I found out that the issue was with this bit of code in my theme.

`function remove_head_scripts() {
remove_action('wp_head', 'wp_print_scripts');
remove_action('wp_head', 'wp_print_head_scripts', 9);
remove_action('wp_head', 'wp_enqueue_scripts', 1);

add_action('wp_footer', 'wp_print_scripts', 5);
add_action('wp_footer', 'wp_enqueue_scripts', 5);
add_action('wp_footer', 'wp_print_head_scripts', 5);
}
add_action( 'wp_enqueue_scripts', 'remove_head_scripts' );`

The code snippet above causes jQuery to be loaded in the footer instead of the header.

I do like loading my jQuery in the footer, but, as you can see, loading it in the footer seems to confuse Editus, possibly because it does not have access to jQuery when the script above is moving jQuery from the header to the footer.

I know a lot of developers like to load their jQuery in the footer. The error above does not just affect Editus, but it breaks all of the JavaScript on the page.

Would you be able to fix this issue? Am I loading my jQuery in the footer wrong? To test it, I think all you have to do is add the code snippet above to your theme.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions