dequeue_visual_composer

Posted in: Newspaper
Post count: 285

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.
Post count: 285

… 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' />
Post count: 9544

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.

Post count: 285

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

Post count: 9544

I am using tdc on all our live sites now.

For the de enqeue snippet, switch to footer unenqueue if using the booster since no longer in head.

Post count: 285

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);
Post count: 7909

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!

Post count: 285

Hi Alin,
I can only say Thank You! greater person.

The matter is resolved.

Post count: 9544

Alin saves the day again!!!

🙂

Post count: 285

Yep, and how!
Thank you guys

Post count: 436

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.
Post count: 285

Hi Nano,
That snnipet will dequeue VC from all posts when you use speed-booster plugin, so pages will not be affected.

  • This reply was modified 9 years by nairolf.
Post count: 436

Oh!Okay. Thank you Nairolf 🙂

Viewing 13 posts - 1 through 13 (of 13 total)
The forum ‘Newspaper’ is closed to new topics and replies.