mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-11 02:49:04 +01:00
Twenty Ten: use callback in functions.php to enqueue scripts and styles rather than putting them directly in header.php template file. Props obenland, fixes #23772.
git-svn-id: http://core.svn.wordpress.org/trunk@23721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
dd99d5ce94
commit
f4b2484cc9
@ -215,6 +215,27 @@ function twentyten_admin_header_style() {
|
|||||||
}
|
}
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enqueue scripts and styles.
|
||||||
|
*
|
||||||
|
* Hooked on priority 0 to make sure they are enqueued prior to dependent
|
||||||
|
* scripts/styles. This is only necessary because they were previously enqueued
|
||||||
|
* prior to wp_head() running, and we want to provide maximum
|
||||||
|
* backwards compatibility.
|
||||||
|
*
|
||||||
|
* @since Twenty Ten 1.6
|
||||||
|
*/
|
||||||
|
function twentyten_scripts() {
|
||||||
|
wp_enqueue_style( 'twentyten', get_stylesheet_uri() );
|
||||||
|
|
||||||
|
/* We add some JavaScript to pages with the comment form
|
||||||
|
* to support sites with threaded comments (when in use).
|
||||||
|
*/
|
||||||
|
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
|
||||||
|
wp_enqueue_script( 'comment-reply' );
|
||||||
|
}
|
||||||
|
add_action( 'wp_enqueue_scripts', 'twentyten_scripts', 0 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
|
* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
|
||||||
*
|
*
|
||||||
|
@ -14,15 +14,8 @@
|
|||||||
<meta charset="<?php bloginfo( 'charset' ); ?>" />
|
<meta charset="<?php bloginfo( 'charset' ); ?>" />
|
||||||
<title><?php wp_title( '|', true, 'right' ); ?></title>
|
<title><?php wp_title( '|', true, 'right' ); ?></title>
|
||||||
<link rel="profile" href="http://gmpg.org/xfn/11" />
|
<link rel="profile" href="http://gmpg.org/xfn/11" />
|
||||||
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
|
|
||||||
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
|
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
|
||||||
<?php
|
<?php
|
||||||
/* We add some JavaScript to pages with the comment form
|
|
||||||
* to support sites with threaded comments (when in use).
|
|
||||||
*/
|
|
||||||
if ( is_singular() && get_option( 'thread_comments' ) )
|
|
||||||
wp_enqueue_script( 'comment-reply' );
|
|
||||||
|
|
||||||
/* Always have wp_head() just before the closing </head>
|
/* Always have wp_head() just before the closing </head>
|
||||||
* tag of your theme, or you will break many plugins, which
|
* tag of your theme, or you will break many plugins, which
|
||||||
* generally use this hook to add elements to <head> such
|
* generally use this hook to add elements to <head> such
|
||||||
|
Loading…
Reference in New Issue
Block a user