WordPress.org

Ready to get started?Download WordPress

Forums

PHP Browser Detection
[resolved] Where? (2 posts)

  1. Regson
    Member
    Posted 5 months ago #

    I'm pretty new to this and I'm unsure where I have to post the code to make it work:
    <?php if(is_chrome($version)) { /* do stuff */ }; ?>

    I put it inside a page in the "text" tab and inserted what I wanted it to do, I tested it on all browsers and it worked for all when I wanted it to only work for Chrome.

    What am I doing wrong? I assume I am not posting it in the correct place.

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

  2. MartyThornley
    Member
    Plugin Author

    Posted 5 months ago #

    Php code like that will only work in the template files, not the post editor.

    Although it makes me think a shortcode option for the plugin might be a nice idea.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.