Support » Plugin: Scroll Triggered Boxes » Open on certain browser possible?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Danny van Kooten

    (@dvankooten)

    Hi Jan,

    Yes, you should be able to do such a thing by adding the following code snippet to your theme its functions.php file.

    function my_prefix_show_box_in_ie($show, $box_id) {
    
     	// change 123 to the ID of the box you want to show on IE only
    	if( $box_id !== 123 ) {
    		return $show;
    	}
    
    	$show = preg_match('~MSIE|Internet Explorer~i', $_SERVER['HTTP_USER_AGENT']);
    
    	return $show;
    }
    
    add_action('stb_show_box', 'my_prefix_show_box_in_ie', 10, 2);

    Hope that sets you off in the right direction, good luck!

    esucces

    (@esucces)

    Hi Danny

    That snippet works, but ignores the defined rule of the box:
    If page is = 25,26.

    Plugin Author Danny van Kooten

    (@dvankooten)

    Hi Jan,

    Wasn’t sure whether you wanted that. If you want to preserve the defined box rules, use the following.

    function my_prefix_show_box_in_ie($show, $box_id) {
    
     	// change 123 to the ID of the box you want to show on IE only
    	if( $box_id !== 123 || $show === false ) {
    		return $show;
    	}
    
    	$show = preg_match('~MSIE|Internet Explorer~i', $_SERVER['HTTP_USER_AGENT']);
    
    	return $show;
    }
    
    add_action('stb_show_box', 'my_prefix_show_box_in_ie', 10, 2);

    Worked perfectly 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Open on certain browser possible?’ is closed to new replies.