Plugin Author
Guido
(@guido07111975)
Hi Ray,
The problem with that piece of code is I have to include a (static) pagename (Contact) so if your contactpage has another name…
And it should always load in case contactform is located in the siderbar of a site. So it’s kind of difficult to find a solid solution for this I guess.
Btw, the css file is tiny so almost no effect on load time of your page.
Note:
I will remove the Custom Style Editor in next update.
Whÿ? Because there are many plugins for that such as my Very Simple Custom Style plugin.
Guido
Thanks, I know the file is tiny, but I’d like to reduce the number of http request a page load requires. Every little bit helps, especially when you run ads as well as regular content. They all add up to slow the site down.
Google Pagespeed also lists the VSCF css file as render blocking.
I don’t use sidebar contact, only use VSCF on one page on my site
In the last thirty days my contact page has had 138 page views but the VSCF css file has had over 80,000 hits.
Best regards, Ray
Plugin Author
Guido
(@guido07111975)
Hi Ray,
I understand what you mean.
If you are using a child theme you can also take a look at this tutorial. Check out the part underneath ‘Disabling styles’.
Guido
Thanks Guido,
Between the info at that tutorial and the original link I posted I created this code and added it to my child themes functions.php contact-us is the slug for my sites contact page
add_action( ‘wp_print_styles’, ‘my_deregister_styles’, 100 );
function my_deregister_styles() {
if ( !is_page(‘contact-us’) ) {
wp_deregister_style( ‘vscf_style’ );
}
}
Now the VSCF css file only loads on my Contact page. 🙂
Cheers Ray
Plugin Author
Guido
(@guido07111975)
For a single site this is a fine solution indeed. But unfortunately I cannot use this in new plugin version because of the static page (contact-us).
Guido