Making WordPress.org

Changeset 379


Ignore:
Timestamp:
02/05/2014 08:08:56 PM (10 years ago)
Author:
nacin
Message:

WP.org P2: Re-register P2's iPhone styles with a media query, to avoid it from being served to desktops in caching situations. fixes #309.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-p2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-p2/functions.php

    r378 r379  
    1010    wp_deregister_style( 'p2' );
    1111    wp_register_style( 'p2', get_template_directory_uri() . '/style.css' );
    12     wp_enqueue_style( 'wporg-p2', get_stylesheet_uri(), array( 'p2' ), '2014-02-05a' );
     12    wp_enqueue_style( 'wporg-p2', get_stylesheet_uri(), array( 'p2' ), '2014-02-05b' );
    1313}
    1414
     
    6565}
    6666
    67  
     67function wporg_p2_iphone_style_override() {
     68    if ( p2_is_iphone() ) {
     69        wp_deregister_style( 'p2-iphone-style' );
     70    }
     71    wp_enqueue_style(
     72        'p2-iphone-style',
     73        get_template_directory_uri() . '/style-iphone.css',
     74        array(),
     75        '20120402',
     76        '(max-width: 320px)'
     77    );
     78}
     79add_action( 'wp_enqueue_scripts', 'wporg_p2_iphone_style_override', 1001 );
     80
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-p2/style.css

    r378 r379  
    238238    display: inline-block;
    239239    width: 30%;
     240    min-width: 290px;
    240241    padding: 1.5%;
    241242}
Note: See TracChangeset for help on using the changeset viewer.