Hi tagDIV, Hi guys, Hi @neotrope, Hi mom,
I have a sore head impressive 🙂
My humble project: theme + VC + yoast + Speed booster
I use VC (visual composer) because I am bound to have it on the home page (the only place where I use it).
If Speed Booster is active can’t dequeue VC style, neither remove_query_arg.
ÂżWHY?
-
This topic was modified 9 years by
nairolf.
… and another strange thing about the same Speed Booster.
We know that WP in the last version add dns-prefetch in to the head.
The following happens when is on or off:
- With speed-booster disabled:
<link rel='dns-prefetch' href='//fonts.googleapis.com' /> - With speed-booster enabled:
<link rel='dns-prefetch' href='//ajax.googleapis.com' />
LOL…
somewhere in forum is a filter for functions to de-enqueue VC for single posts, or anything not home page. I did that before moving to the interim “shim” beta Radu did a long time back, and now the TD Composer beta (try it!). TDC gives you most of the modules from VC without all the goofy stuff, and soooooo much faster.
Don’t have the code handy, but you can de-enqueue anything, you just have to play with the “naming” of it and wrap in a if ! home statement (so, “if not home, de-enqueye pesky VC …”)
Sadly i have so zillion posts I can’t find anything of mine anymore after 3 years, so either go on safari in the forum (and pull hair out), or wait for the tagdivvy folks to repost the sneaky cool way to do that.
Hi Chris,
The snippet works but only if the Speed-Booster (tagDIV plugin) is disabled
function dequeue_visual_composer_css() {
if (is_single()) {
wp_dequeue_style('js_composer_front');
}
}
add_action('wp_enqueue_scripts', 'dequeue_visual_composer_css', 1003);
I believe that TDC is still “green” for production, in the near future I give it a shoot
Nope,
Even if I change the action for footer, nothing!
(the styleID is correct, I down the priority also), I lose something?
function dequeue_visual_composer_css() {
if (is_single()) {
wp_dequeue_style('js_composer_front');
}
}
add_action('wp_footer', 'dequeue_visual_composer_css', 1);
Hi,
You can unset it directly from speed booster file – http://screencast.com/t/oePHmpMHV
if(is_single()){
unset($this->style_footer_queue['js_composer_front']);
}
Thanks!
Hey Chris and Nairolf, Excuse me for not getting this correctly.
But what will happen if I used this code suggested by Alin in the speed booster files:
if(is_single()){
unset($this->style_footer_queue['js_composer_front']);
}
Will it load VC files only on Homepage, not on any other pages?
I do use VC on few other pages other than homepage should I use this code for speed optimization?
Thank you.
-
This reply was modified 9 years by
Nano.