WordPress.org

Forums

The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

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

  1. Ryan
    Member
    Posted 3 years 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 Labs, Inc.
    Member
    Plugin Author

    Posted 2 years 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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • PHP Browser Detection
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic