• Resolved Chris Fontes

    (@chrisfontes)


    I am trying to speed up my site, and I have realized that this entire package of scripts gets enqueued on EVERY page, even if I do not have a Store Locator on that page.

    I have hand coded a simple if statement to solve my issue for now, but I think an elegant option would be to either “auto detect” the short_code and load the scripts, or even less fancy, just have a spot where you can “limit scripts to the following pages:” and let uses say what pages they need it on.

    I have wrapped the __construct() add_actions in class-stores-frontend.php with the if stripos($_SERVER[‘REQUEST_URI’], “my-store-finder-permalink”

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Limit Enqueue Scripts to Locator Page’ is closed to new replies.