WordPress.org

Make WordPress Core

Ticket #12932: enqueue_twentyten.diff

File enqueue_twentyten.diff, 2.1 KB (added by ptahdunbar, 5 years ago)
  • wp-content/themes/twentyten/functions.php

     
    166166} 
    167167endif; 
    168168 
     169/** 
     170 * Enqueue the CSS stylesheets for twentyten 
     171 * 
     172 * @since 3.0.0 
     173 **/ 
     174function twentyten_enqueue_styles() { 
     175        if ( !is_admin() ) { 
     176                wp_enqueue_style( 'twentyten_style', get_bloginfo( 'stylesheet_url' ) ); 
     177                wp_enqueue_style( 'twentyten_print', get_stylesheet_directory_uri() . '/print.css', null, false, 'print' );      
     178        } 
     179} 
     180add_action( 'init', 'twentyten_enqueue_styles' ); 
     181 
     182/** 
     183 * Enqueues the javascript for comment replys 
     184 * 
     185 * @since 3.0.0 
     186 **/ 
     187function twentyten_enqueue_scripts() { 
     188        if ( is_singular() and get_site_option('thread_comments') ) { 
     189                wp_print_scripts( 'comment-reply' ); 
     190        } 
     191} 
     192add_action( 'wp_head', 'twentyten_enqueue_scripts' ); 
     193 
    169194if ( ! function_exists( 'twentyten_admin_header_style' ) ) : 
    170195/** 
    171196 * Styles the header image displayed on the Appearance > Header admin panel. 
     
    438463        global $wp_widget_factory; 
    439464        remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); 
    440465} 
    441 add_action( 'widgets_init', 'twentyten_remove_recent_comments_style' ); 
     466add_action( 'widgets_init', 'twentyten_remove_recent_comments_style' ); 
     467 No newline at end of file 
  • wp-content/themes/twentyten/header.php

     
    99 * @since 3.0.0 
    1010 */ 
    1111?> 
    12  
    1312<!DOCTYPE html> 
    1413<html <?php language_attributes(); ?>> 
    1514<head> 
     
    3130                } 
    3231        ?></title> 
    3332        <link rel="profile" href="http://gmpg.org/xfn/11" /> 
    34         <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> 
    35         <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?> 
    3633        <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> 
    3734        <?php wp_head(); ?> 
    3835</head>