开发者

Disable Shadowbox.JS on certain Wordpress themes

I am trying to set up two versions to my Wordpress website: Full website, for computers, and Mobile version, for smartphones.

I achieve this by means of a user-agent detection script included in the header.php of the full theme (path is whatevercorp.net/wordpress/wp-content/themes/moneyblog/mobiledetect.php ). If it detects a mobile browser, then it redirects to the mobile theme. I use the Theme Switcher plugin for this.

if($mobile_browser>0) {
header( 'Location: http://whatevercorp.net/?wptheme=mobiblog' );

("mobiblog" is the nam开发者_如何学编程e of my mobile theme)

My questions is this: I use Shadowbox for photos in the full version, but I want to prevent loading it altogether as soon as a mobile browser is detected. I don't want users to view photos with shadowbox when on the mobile version. If the plugin is disabled the links work just fine and *whatevercorp.net/photosfromevent/img_001.jpg* is opened no problem.

Ideally I'd like to introduce something in the if statement from mobiledetect.php. Someone suggested this

 add_filter('shadowbox-js', '__return_false');

but it doesn't do the trick.

How can I condition the loading of the Shadowbox plugin? Thanks!


Why are you reposting this so quickly?

Original question: How to manually add Shadowbox.setup() to the footer of your theme?


I'm not, I'd like to know the answers separately! This one, how to disable a plugin from within a PHP, that other one - how to make use of that thing in the Advanced settings in order to achieve my goal. It's true, the goal is the same for both.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜