WordPress.org

Making WordPress.org

Changeset 849


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

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

Location:
sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012
Files:
2 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
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/header.php

    r848 r849  
    4141    ?></title>
    4242<link rel="profile" href="http://gmpg.org/xfn/11" />
    43 <link rel="stylesheet" type="text/css" media="all" href="<?php echo get_stylesheet_uri(); ?>?v=2" />
    4443<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    4544<?php
    46     /* We add some JavaScript to pages with the comment form
    47      * to support sites with threaded comments (when in use).
    48      */
    49     if ( is_singular() && get_option( 'thread_comments' ) )
    50         wp_enqueue_script( 'comment-reply' );
    51        
    52     if ( is_front_page() || is_page('about') )
    53         wp_enqueue_script( 'jquery-cycle', get_stylesheet_directory_uri() . '/js/jquery.cycle.min.js', array( 'jquery' ) )  ;
    54 
    5545    /* Always have wp_head() just before the closing </head>
    5646     * tag of your theme, or you will break many plugins, which
Note: See TracChangeset for help on using the changeset viewer.