WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Theme: Twenty Twelve] Loading Javascript (4 posts)

  1. Evanstang
    Member
    Posted 11 months ago #

    Hi!

    I am trying to call the below javascript:
    http://code.google.com/p/css3-mediaqueries-js/

    1. I have uploaded the script via FTP in the "js" sub folder under the "theme" folder.

    2. I am trying to call the script in functions.php (child theme):
    <?php
    function load_js() {
    wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/css3-mediaqueries.js', array(), '1.0', true );
    }

    3. The point of this script is to prevent older browsers/ my Iphone browser from switching to the mobile site. It seems this is a characteristic of the twenty twelve theme. http://core.trac.wordpress.org/ticket/22044

    It is still not working. Complete newbie here and I would appreciate any advice/help. Thanks for your patience.

    Cheers,
    Evans
    http://www.evanstang.com

  2. paulwpxp
    Font hero
    Posted 11 months ago #

    The function doesn't hook to anything yet, so it would do nothing, and the handle there is the same name of one already used ( must not be the same name ), also the path is pointing to parent's theme folder instead of child.

    But anyway, on your point number 3 here

    The point of this script is to prevent older browsers/ my Iphone browser from switching to the mobile site.

    It seems to me that you've confused media query with browser. The behavior of Twentytwelve in small screen is by design, it has nothing to do with browser.

    Your old iphone will always see Twentytwelve just like that regardless of what browser installed because the media queries detect the screen width.

  3. anantshri
    Member
    Posted 10 months ago #

    @paulwpxp old browsers including IE7/8 don't support media queries so for them twentytwelve will also show the mobile version this script is need to work with that.

    BTW i personally do not feel like supporting old browser and prefer to intentionally brake my website for browsers less then IE9

  4. Evanstang
    Member
    Posted 10 months ago #

    I have switched to the twenty ten theme and rewrote the css. The site works ok now on older/IE browsers as well as on mobile devices.

    -Evans
    http://www.evanstang.com

Reply

You must log in to post.

About this Topic