Making WordPress.org


Ignore:
Timestamp:
01/12/2015 11:04:28 PM (10 years ago)
Author:
obenland
Message:

WP.org Theme: Move scripts to the header of the page.

This helps avoiding the flash of server-rendered themes on first load.

See #745.

File:
1 edited

Legend:

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

    r1119 r1134  
    8282
    8383    if ( ! is_singular( 'page' ) ) {
    84         wp_enqueue_script( 'theme', self_admin_url( 'js/theme.js' ), array( 'wp-backbone' ), false, 1 );
    85         wp_enqueue_script( 'wporg-theme', get_template_directory_uri() . '/js/theme.js', array( 'theme' ), false, 1 );
     84        wp_enqueue_script( 'theme', self_admin_url( 'js/theme.js' ), array( 'wp-backbone' ) );
     85        wp_enqueue_script( 'wporg-theme', get_template_directory_uri() . '/js/theme.js', array( 'theme' ) );
    8686
    8787        wp_localize_script( 'theme', '_wpThemeSettings', array(
     
    240240    get_template_part( 'view-templates/theme-single' );
    241241}
    242 add_action( 'wp_footer', 'wporg_themes_view_templates' );
     242add_action( 'wp_head', 'wporg_themes_view_templates' );
Note: See TracChangeset for help on using the changeset viewer.