Click to Play

Intel's Infoscape Makes Info...
Intel's Infoscape HD display was one of the biggest attractions at CES 2010. Lines of people surrounded the proof-of-concept piece hoping to get their hands on...

Recent Articles

To Create Compelling Headlines You Need To...
Here's a synopsis of an excellent post by Adam Singer, How to Write Compelling Social News Headlines; check out the complete source article for a discussion...

SEO Tools To Analyze Your Clients And...
There are a number of SEO tools I use on a daily basis to help me analyze a client or competitors website. I will use specific tools depending on what type of data I am looking to analyze. These tools can save you...

Building Your Site For Your End User Not Your Rank
I am here at Search Engine Stratgies Chicago 2009 and today I had the pleasure of enjoying a wonderful panel on analytics with Jim Sterne, Matt Bailey, and...

Fixing Simple Issues To Get Your Site Listed With Google
In the world of SEO, there's nothing worse than finding out that your site is no longer listed in the search engines. In many cases, you may be missing...


01.27.10

Cleaning And Speeding Up Your WordPress Blog

By Debbie Campbellz

This is a followup to my previous post on adding scripts only to the WordPress pages that need them. Please read that first, or this might not make much sense…

To cleanup the dynamically generated head section even more, you can disable the styles associated with scripts that aren't loaded on every page.

The easy way to do this is very similar to what I talked about last time – add this code to your functions.php file (or custom-functions.php if your theme supports it):



The plugin I'm working on is WPNG Calendar, which displays a stream of events from Google Calendar. I want to show it, in this case, only on the site's About Us page. I've already deregistered the scripts associated with WPNG Calendar on most pages, so now I want to hide the styles on the same pages (why load them if you don't need them?).

So now you'll do the same thing as in the previous post with a twist:

Host Unlimited Websites - Only $7.95 a Month
Get Started Now

• View the source for a page on your site and find the CSS stylesheet links associated with the plugin that you've already deregistered on most pages;

• Open up the file that calls that stylesheet – in my case I'm looking at wpng-calendar.php.

• Search for wp_enqueue_style within the PHP file and find the handle for the stylesheet you want to deregister. The handle is the first element in parentheses after the wp_enqueue_style element – in the snippet above they are thickbox and style.

A Problem That You Can Fix Yourself!
What happens if you can't find a 'wp_enqueue_style' in your PHP file? This is unfortunate; it means that the plugin creator isn't making easy for you. Using wp_enqueue_script and wp_enqueue_style makes it simple to work with the tools WordPress has built-in, but there's a way around this.

Look for a link that calls a stylesheet – something like this:



Comment that line out and add your own wp_enqueue_style line, replacing the handle with the stylesheet name and editing the source link as needed (refer to this reference for parameters, I didn't include what I wasn't sure about):

Continue reading this article.


About the Author:
Debbie Campbell Red Kite Creative | Web Design Blog
About TheDevWeb
TheDevWeb examines the best tools and techniques to help you keep up with all the latest trends in the fast paced world of web development. Excellence in Development Starts Here





TheDevWeb is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com ITmanagementNews.com





-- TheDevWeb is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2010 iEntry, Inc. All Rights Reserved Privacy Policy Legal

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article



Excellence in Development Starts Here TheDevWeb News Archives About Us Feedback TheDevWeb Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact