deactivate plugin on posts where there is no pano
-
Hi,
I have panoramas only in a small fraction of posts in my blog but the PanoPress code is being loaded for every single post, whether needed or not.
Now, usually I’d use a conditional wp_deregister_script() in my functions.php to do this, like:
if (!in_category('panorama') {wp_deregister_script('script-handle')}
But as PanoPres doesn’t seam to use wp_enqueue_script() for including the plugin in WordPress, this doen’t work.
Is there any other way to deactivate the plugin in non-panorama posts (= e.g. posts in a specific category)?
Why would I want to do this anyway? Better performance for the majority of my posts as the PanoPress scripts are pretty heavy …
Thanks ans kind regards
FranzP.S.: By the way, thanks for this great plugin!!
- The topic ‘deactivate plugin on posts where there is no pano’ is closed to new replies.