wpDiscuz - WordPress Comment Plugin
Share:
Notifications
Clear all

hide bubble on Mobile / Remove wp-discuz on Mobile


casadeltravel
Posts: 14
Topic starter
(@casadeltravel)
Active Member
Joined: 1 year ago

Dear Forum,

I have 2 questions : 

First : Is it possible to hide wpd-bubble on mobile devices and How can i do it ?

Second : To get better pagespeed score on mobile, can i remove wpdiscuz on this device ?

Thanks

3 Replies
Asti
Posts: 3913
 Asti
Support
(@asti)
Support member
Joined: 4 years ago

Hi @casadeltravel

You should use the is_load_wpdiscuz hook and remove the comments on mobile devices. 

Reply
makemelodies
Posts: 1
(@makemelodies)
New Member
Joined: 7 months ago

Sample code please on how to do this? I have been trying this but it's not working:

add_filter('is_load_wpdiscuz', function ($isLoad, $post) {
if (wp_is_mobile()) {
return false;
}
return $isLoad;
}, 10,2);

Reply
1 Reply
Asti
 Asti
Support
(@asti)
Joined: 4 years ago

Support member
Posts: 3913

@makemelodies,

The code works fine. We've just checked it. 

Please try on incognito mode if you're checking on mobile devices. Because mobile browsers have a hard cache, you'll not be able to see the change immediately.

Reply
Share: