Making WordPress.org


Ignore:
Timestamp:
09/10/2014 06:49:58 PM (11 years ago)
Author:
iandunn
Message:

Central Theme: Enqueue CSS and JS instead of printing directly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/functions.php

    r848 r849  
    180180     */
    181181    static function enqueue_scripts() {
     182        wp_enqueue_style( 'central', get_stylesheet_uri(), array(), 3 );
    182183        wp_enqueue_script( 'central-navigation', get_stylesheet_directory_uri() . '/js/navigation.js', array(), '20140909', true );
     184
     185        /* We add some JavaScript to pages with the comment form
     186         * to support sites with threaded comments (when in use).
     187         */
     188        if ( is_singular() && get_option( 'thread_comments' ) ) {
     189            wp_enqueue_script( 'comment-reply' );
     190        }
     191
     192        if ( is_front_page() || is_page( 'about' ) ) {
     193            wp_enqueue_script( 'jquery-cycle', get_stylesheet_directory_uri() . '/js/jquery.cycle.min.js', array( 'jquery' ) );
     194        }
     195
    183196    }
    184197
Note: See TracChangeset for help on using the changeset viewer.