Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts and styles are enqueued when not needed #18

Closed
BinaryMoon opened this issue Aug 14, 2016 · 7 comments
Closed

scripts and styles are enqueued when not needed #18

BinaryMoon opened this issue Aug 14, 2016 · 7 comments
Assignees
Labels

Comments

@BinaryMoon
Copy link
Contributor

The scripts and styles are enqueued on every page, regardless of whether the page supports tailor (home page, and archives), or whether the user can make use of tailor. By that I mean that admin styles are enqueued for public visitors.

@andrew-worsfold
Copy link
Contributor

Replicated and fixed. This will be addressed in the next version.

@andrew-worsfold
Copy link
Contributor

This should be addressed in the latest version (1.5.0). Are you able to confirm that the issue has been resolved?

@BinaryMoon
Copy link
Contributor Author

confirmed. All working well :)

@BinaryMoon
Copy link
Contributor Author

sorry - not confirmed - I thought this was the spinner one.

On the homepage and category pages I am seeing the 'tailor-styles-css' stylesheet still included, along with the following js:

  • /assets/js/dist/frontend.min.js
  • /assets/js/dist/vendor/slick.min.js
  • /assets/js/dist/vendor/modernizr.min.js
  • /assets/js/dist/vendor/shuffle.min.js
  • /assets/js/dist/vendor/magnific-popup.min.js

@andrew-worsfold
Copy link
Contributor

I've added an additional check (is_singular()) to ensure scripts are not loaded for archive pages. Is that working for you too?

@BinaryMoon
Copy link
Contributor Author

BinaryMoon commented Aug 23, 2016

Do you mean the check in includes/helpers/helpers-settings.php?

At the moment that check is saying:

    if ( ! is_singular() || tailor()->is_canvas() || tailor()->is_template_preview() ) {
        return true;
    }

But that says - if not a single page then include scripts doesn't it?

If you change it to:

    if ( ! is_singular() ) {
        return false;
    }

    if ( tailor()->is_canvas() || tailor()->is_template_preview() ) {
        return true;
    }

Then it works - at least on my local install.

@andrew-worsfold
Copy link
Contributor

True - that's what happens when I try to do things late at night! :)

I've verified that this works as expected and included it in the latest version.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants