Solved

Scripts & Style Sheets only used on required pages.

Posted on 2014-02-12
7
274 Views
Last Modified: 2014-02-13
Some of my wordpress websites have many plugins which generate lots of links to Scripts & Style Sheets.

Some of these Scripts & Style Sheets are only required on one page however Wordpress links to them on every page usually via the header.

Does anyone know of a method or plugin to restrict Scripts & Style Sheets used only the ones used on the relevant page?
0
Comment
Question by:petewinter
  • 3
  • 3
7 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 39854374
How is the "relevant page" to be determined?  All WordPress knows is that you have installed something.
0
 

Author Comment

by:petewinter
ID: 39854413
Open to idea's. Can it be done via template?
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 39854573
Sort of.  The issue is that the plugins are the ones adding the calls to the files so any solution involving conditional code would probably involve altering the plugin.  Once you do that, you either have to fork it or not update it as the next update will blow away any changes.
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39854932
Why do you want to do this?  What is your goal?
0
 

Author Comment

by:petewinter
ID: 39855453
I want to reduce calls and help page speed
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 39855461
The better way to do this may be to minify and combine CSS and JS files.  W3 Total Cache can do it or you can hook onto a CDN service that will do it too.
0
 

Author Closing Comment

by:petewinter
ID: 39855602
Okay. Thanks for the advice
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to count occurrences of each item in an array.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question