WordPress.org

Support

Support » Themes and Templates » [Resolved] [Theme: Twenty Twelve] Loading Javascript

[Resolved] [Theme: Twenty Twelve] Loading Javascript

  • 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

Viewing 3 replies - 1 through 3 (of 3 total)
  • paulwpxp

    @paulwp

    Font hero

    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.

    @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

    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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] [Theme: Twenty Twelve] Loading Javascript’ is closed to new replies.
Skip to toolbar