Solved

Scripts & Style Sheets only used on required pages.

Posted on 2014-02-12
7
277 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

726 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