WordPress.org

Ready to get started?Download WordPress

Forums

PHP Browser Detection
[resolved] How do display alternate content if Chrome and OS X? (2 posts)

  1. Ryan
    Member
    Posted 10 months ago #

    I have javascript on my homepage that does not run on Chrome in OS X and I'm looking to display alternate content. At the moment I have this code which displays alternate content if it's Chrome on any OS, but the issue only happens on Chrome for OS X. Any ideas how to accomplish this?

    <?php if(is_chrome()) : ?>
    
    Alternate Content.
    
    <?php else : ?>
    
    Normal Content.
    
    <?php endif; ?>

    http://wordpress.org/plugins/php-browser-detection/

  2. Mindshare Studios, Inc.
    Member
    Plugin Author

    Posted 9 months ago #

    You'd need to use the php_browser_info() function to check the platform variable in order to test for OSX. Check out the tests.php file on your site and look for the [platform] entry.

Reply

You must log in to post.

About this Plugin

About this Topic