This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Reply To: replacing prettyphoto, other scripts…

#1912
Israel Curtis
Participant

I think I found it (though I don’t completely understand it) – it seems your dependency system is re-enqueueing it after I’ve dequeued it (as I noticed it was showing up at the bottom of the list in my source). So by filtering here (and removing prettyphoto from the array), it doesn’t get re-added.

themeblvd_include_styles in general.php:
apply_filters( 'themeblvd_framework_stylesheets', array( 'bootstrap', 'fontawesome', 'prettyphoto', 'themeblvd' ) );

What’s particularly confusing about this filter is you can’t depend on it alone to remove a script/style from the queue, but if you don’t filter it, the same script/style you’re trying to remove will be re-added.

So in the end, I have to both dequeue the prettyphoto styles and scripts, as well as hook the filter. I would suggest modifying your dependency filter routines to fully control loading of these various components. Then a simple filter hook is all that’s needed to modify the output.