Clicky

  1. Home
  2. How To
  3. How to enable or disable mobile redirection through conditions

How to enable or disable mobile redirection through conditions

If you want to enable or disable mobile redirection through conditions then first you need to create a Custom Plugin and through the filter.

add_filter('ampforwp_modify_mobile_redirection' ,'prefix_mobile_support'); 
function prefix_mobile_support($mobile){
 if(!is_category('sports')){ //Mobile Redirection will only work for sports category 
$mobile = true;
 }
 return $mobile;
 }

That’s it for this tutorial!

We hope it helped you. If you have any feedback or questions, then please share them in the comments section below.

Ask your Questions Directly!
If you can't find the solutions in this article, then just ask us in the comments and we will answer it for you!
Updated on May 24, 2021

    Are you still looking for a solution?

    Then fill out the below form and we will reach out to you within a few hours.


    Was this article helpful?

    Related Articles

    Leave a Comment