Scotsto

header function php

Mar 19th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.03 KB | None | 0 0
  1. Header.php
  2. <?php
  3. /**
  4. * The Header template for our theme
  5. *
  6. * Displays all of the <head> section and everything up till <div id="main">
  7. *
  8. * @package WordPress
  9. * @subpackage Twenty_Twelve
  10. * @since Twenty Twelve 1.0
  11. */
  12. ?><!DOCTYPE html>
  13. <!--[if IE 7]>
  14. <html class="ie ie7" <?php language_attributes(); ?>>
  15. <![endif]-->
  16. <!--[if IE 8]>
  17. <html class="ie ie8" <?php language_attributes(); ?>>
  18. <![endif]-->
  19. <!--[if !(IE 7) | !(IE 8) ]><!-->
  20. <html <?php language_attributes(); ?>>
  21. <!--<![endif]-->
  22. <head>
  23. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  24. <meta name="viewport" content="width=device-width,initial-scale=1"/>
  25. <title><?php wp_title( '|', true, 'right' ); ?></title>
  26. <link rel="profile" href="http://gmpg.org/xfn/11" />
  27. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
  28. <?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?>
  29. <!--[if lt IE 9]>
  30. <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
  31. <![endif]-->
  32. <?php wp_head(); ?>
  33. </head>
  34.  
  35. <body <?php body_class(); ?>>
  36. <div id="page" class="hfeed site">
  37. <header id="masthead" class="site-header" role="banner">
  38. <hgroup>
  39. <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img class="alignleft wp-image-1039" alt="logo redrawn" src="http://c6748260.myzen.co.uk/wp-content/uploads/2013/12/logo-redrawn-150x150.jpg" width="95" height="95" /><?php bloginfo( 'name' ); ?></a></h1>
  40. <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
  41. https://themes.svn.wordpress.org/twentytwelve/1.6/header.php
  42. </hgroup>
  43. <nav id="site-navigation" class="main-navigation" role="navigation">
  44. <h3 class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></h3>
  45. <a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a>
  46. <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
  47. </nav><!-- #site-navigation -->
  48.  
  49. </header><!-- #masthead -->
  50.  
  51. <div id="main" class="wrapper">
  52.  
  53. Functions.php
  54. <?php
  55. /**
  56. * Twenty Twelve functions and definitions
  57. *
  58. * Sets up the theme and provides some helper functions, which are used
  59. * in the theme as custom template tags. Others are attached to action and
  60. * filter hooks in WordPress to change core functionality.
  61. *
  62. * When using a child theme (see http://codex.wordpress.org/Theme_Development and
  63. * http://codex.wordpress.org/Child_Themes), you can override certain functions
  64. * (those wrapped in a function_exists() call) by defining them first in your child theme's
  65. * functions.php file. The child theme's functions.php file is included before the parent
  66. * theme's file, so the child theme functions would be used.
  67. *
  68. * Functions that are not pluggable (not wrapped in function_exists()) are instead attached
  69. * to a filter or action hook.
  70. *
  71. * For more information on hooks, actions, and filters, @link http://codex.wordpress.org/Plugin_API
  72. *
  73. * @package WordPress
  74. * @subpackage Twenty_Twelve
  75. * @since Twenty Twelve 1.0
  76. */
  77.  
  78. // Set up the content width value based on the theme's design and stylesheet.
  79. if ( ! isset( $content_width ) )
  80. $content_width = 625;
  81.  
  82. /**
  83. * Twenty Twelve setup.
  84. *
  85. * Sets up theme defaults and registers the various WordPress features that
  86. * Twenty Twelve supports.
  87. *
  88. * @uses load_theme_textdomain() For translation/localization support.
  89. * @uses add_editor_style() To add a Visual Editor stylesheet.
  90. * @uses add_theme_support() To add support for post thumbnails, automatic feed links,
  91. * custom background, and post formats.
  92. * @uses register_nav_menu() To add support for navigation menus.
  93. * @uses set_post_thumbnail_size() To set a custom post thumbnail size.
  94. *
  95. * @since Twenty Twelve 1.0
  96. */
  97. function twentytwelve_setup() {
  98. /*
  99. * Makes Twenty Twelve available for translation.
  100. *
  101. * Translations can be added to the /languages/ directory.
  102. * If you're building a theme based on Twenty Twelve, use a find and replace
  103. * to change 'twentytwelve' to the name of your theme in all the template files.
  104. */
  105. load_theme_textdomain( 'twentytwelve', get_template_directory() . '/languages' );
  106.  
  107. // This theme styles the visual editor with editor-style.css to match the theme style.
  108. add_editor_style();
  109.  
  110. // Adds RSS feed links to <head> for posts and comments.
  111. add_theme_support( 'automatic-feed-links' );
  112.  
  113. // This theme supports a variety of post formats.
  114. add_theme_support( 'post-formats', array( 'aside', 'image', 'link', 'quote', 'status' ) );
  115.  
  116. // This theme uses wp_nav_menu() in one location.
  117. register_nav_menu( 'primary', __( 'Primary Menu', 'twentytwelve' ) );
  118.  
  119. /*
  120. * This theme supports custom background color and image,
  121. * and here we also set up the default background color.
  122. */
  123. add_theme_support( 'custom-background', array(
  124. 'default-color' => 'e6e6e6',
  125. ) );
  126.  
  127. // This theme uses a custom image size for featured images, displayed on "standard" posts.
  128. add_theme_support( 'post-thumbnails' );
  129. set_post_thumbnail_size( 624, 9999 ); // Unlimited height, soft crop
  130. }
  131. add_action( 'after_setup_theme', 'twentytwelve_setup' );
  132.  
  133. /**
  134. * Add support for a custom header image.
  135. */
  136. require( get_template_directory() . '/inc/custom-header.php' );
  137.  
  138. /**
  139. * Return the Google font stylesheet URL if available.
  140. *
  141. * The use of Open Sans by default is localized. For languages that use
  142. * characters not supported by the font, the font can be disabled.
  143. *
  144. * @since Twenty Twelve 1.2
  145. *
  146. * @return string Font stylesheet or empty string if disabled.
  147. */
  148. function twentytwelve_get_font_url() {
  149. $font_url = '';
  150.  
  151. /* translators: If there are characters in your language that are not supported
  152. * by Open Sans, translate this to 'off'. Do not translate into your own language.
  153. */
  154. if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'twentytwelve' ) ) {
  155. $subsets = 'latin,latin-ext';
  156.  
  157. /* translators: To add an additional Open Sans character subset specific to your language,
  158. * translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language.
  159. */
  160. $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'twentytwelve' );
  161.  
  162. if ( 'cyrillic' == $subset )
  163. $subsets .= ',cyrillic,cyrillic-ext';
  164. elseif ( 'greek' == $subset )
  165. $subsets .= ',greek,greek-ext';
  166. elseif ( 'vietnamese' == $subset )
  167. $subsets .= ',vietnamese';
  168.  
  169. $protocol = is_ssl() ? 'https' : 'http';
  170. $query_args = array(
  171. 'family' => 'Open+Sans:400italic,700italic,400,700',
  172. 'subset' => $subsets,
  173. );
  174. $font_url = add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" );
  175. }
  176.  
  177. return $font_url;
  178. }
  179.  
  180. /**
  181. * Enqueue scripts and styles for front-end.
  182. *
  183. * @since Twenty Twelve 1.0
  184. *
  185. * @return void
  186. */
  187. function twentytwelve_scripts_styles() {
  188. global $wp_styles;
  189.  
  190. /*
  191. * Adds JavaScript to pages with the comment form to support
  192. * sites with threaded comments (when in use).
  193. */
  194. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
  195. wp_enqueue_script( 'comment-reply' );
  196.  
  197. // Adds JavaScript for handling the navigation menu hide-and-show behavior.
  198. wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '1.0', true );
  199.  
  200. $font_url = twentytwelve_get_font_url();
  201. if ( ! empty( $font_url ) )
  202. wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null );
  203.  
  204. // Loads our main stylesheet.
  205. wp_enqueue_style( 'twentytwelve-style', get_stylesheet_uri() );
  206.  
  207. // Loads the Internet Explorer specific stylesheet.
  208. wp_enqueue_style( 'twentytwelve-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentytwelve-style' ), '20121010' );
  209. $wp_styles->add_data( 'twentytwelve-ie', 'conditional', 'lt IE 9' );
  210. }
  211. add_action( 'wp_enqueue_scripts', 'twentytwelve_scripts_styles' );
  212.  
  213. /**
  214. * Filter TinyMCE CSS path to include Google Fonts.
  215. *
  216. * Adds additional stylesheets to the TinyMCE editor if needed.
  217. *
  218. * @uses twentytwelve_get_font_url() To get the Google Font stylesheet URL.
  219. *
  220. * @since Twenty Twelve 1.2
  221. *
  222. * @param string $mce_css CSS path to load in TinyMCE.
  223. * @return string Filtered CSS path.
  224. */
  225. function twentytwelve_mce_css( $mce_css ) {
  226. $font_url = twentytwelve_get_font_url();
  227.  
  228. if ( empty( $font_url ) )
  229. return $mce_css;
  230.  
  231. if ( ! empty( $mce_css ) )
  232. $mce_css .= ',';
  233.  
  234. $mce_css .= esc_url_raw( str_replace( ',', '%2C', $font_url ) );
  235.  
  236. return $mce_css;
  237. }
  238. add_filter( 'mce_css', 'twentytwelve_mce_css' );
  239.  
  240. /**
  241. * Filter the page title.
  242. *
  243. * Creates a nicely formatted and more specific title element text
  244. * for output in head of document, based on current view.
  245. *
  246. * @since Twenty Twelve 1.0
  247. *
  248. * @param string $title Default title text for current view.
  249. * @param string $sep Optional separator.
  250. * @return string Filtered title.
  251. */
  252. function twentytwelve_wp_title( $title, $sep ) {
  253. global $paged, $page;
  254.  
  255. if ( is_feed() )
  256. return $title;
  257.  
  258. // Add the site name.
  259. $title .= get_bloginfo( 'name' );
  260.  
  261. // Add the site description for the home/front page.
  262. $site_description = get_bloginfo( 'description', 'display' );
  263. if ( $site_description && ( is_home() || is_front_page() ) )
  264. $title = "$title $sep $site_description";
  265.  
  266. // Add a page number if necessary.
  267. if ( $paged >= 2 || $page >= 2 )
  268. $title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) );
  269.  
  270. return $title;
  271. }
  272. add_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 );
  273.  
  274. /**
  275. * Filter the page menu arguments.
  276. *
  277. * Makes our wp_nav_menu() fallback -- wp_page_menu() -- show a home link.
  278. *
  279. * @since Twenty Twelve 1.0
  280. */
  281. function twentytwelve_page_menu_args( $args ) {
  282. if ( ! isset( $args['show_home'] ) )
  283. $args['show_home'] = true;
  284. return $args;
  285. }
  286. add_filter( 'wp_page_menu_args', 'twentytwelve_page_menu_args' );
  287.  
  288. /**
  289. * Register sidebars.
  290. *
  291. * Registers our main widget area and the front page widget areas.
  292. *
  293. * @since Twenty Twelve 1.0
  294. */
  295. function twentytwelve_widgets_init() {
  296. register_sidebar( array(
  297. 'name' => __( 'Main Sidebar', 'twentytwelve' ),
  298. 'id' => 'sidebar-1',
  299. 'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'twentytwelve' ),
  300. 'before_widget' => '<aside id="%1$s" class="widget %2$s">',
  301. 'after_widget' => '</aside>',
  302. 'before_title' => '<h3 class="widget-title">',
  303. 'after_title' => '</h3>',
  304. ) );
  305.  
  306. register_sidebar( array(
  307. 'name' => __( 'First Front Page Widget Area', 'twentytwelve' ),
  308. 'id' => 'sidebar-2',
  309. 'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ),
  310. 'before_widget' => '<aside id="%1$s" class="widget %2$s">',
  311. 'after_widget' => '</aside>',
  312. 'before_title' => '<h3 class="widget-title">',
  313. 'after_title' => '</h3>',
  314. ) );
  315.  
  316. register_sidebar( array(
  317. 'name' => __( 'Second Front Page Widget Area', 'twentytwelve' ),
  318. 'id' => 'sidebar-3',
  319. 'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ),
  320. 'before_widget' => '<aside id="%1$s" class="widget %2$s">',
  321. 'after_widget' => '</aside>',
  322. 'before_title' => '<h3 class="widget-title">',
  323. 'after_title' => '</h3>',
  324. ) );
  325. }
  326. add_action( 'widgets_init', 'twentytwelve_widgets_init' );
  327.  
  328. if ( ! function_exists( 'twentytwelve_content_nav' ) ) :
  329. /**
  330. * Displays navigation to next/previous pages when applicable.
  331. *
  332. * @since Twenty Twelve 1.0
  333. */
  334. function twentytwelve_content_nav( $html_id ) {
  335. global $wp_query;
  336.  
  337. $html_id = esc_attr( $html_id );
  338.  
  339. if ( $wp_query->max_num_pages > 1 ) : ?>
  340. <nav id="<?php echo $html_id; ?>" class="navigation" role="navigation">
  341. <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>
  342. <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentytwelve' ) ); ?></div>
  343. <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?></div>
  344. </nav><!-- #<?php echo $html_id; ?> .navigation -->
  345. <?php endif;
  346. }
  347. endif;
  348.  
  349. if ( ! function_exists( 'twentytwelve_comment' ) ) :
  350. /**
  351. * Template for comments and pingbacks.
  352. *
  353. * To override this walker in a child theme without modifying the comments template
  354. * simply create your own twentytwelve_comment(), and that function will be used instead.
  355. *
  356. * Used as a callback by wp_list_comments() for displaying the comments.
  357. *
  358. * @since Twenty Twelve 1.0
  359. *
  360. * @return void
  361. */
  362. function twentytwelve_comment( $comment, $args, $depth ) {
  363. $GLOBALS['comment'] = $comment;
  364. switch ( $comment->comment_type ) :
  365. case 'pingback' :
  366. case 'trackback' :
  367. // Display trackbacks differently than normal comments.
  368. ?>
  369. <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
  370. <p><?php _e( 'Pingback:', 'twentytwelve' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?></p>
  371. <?php
  372. break;
  373. default :
  374. // Proceed with normal comments.
  375. global $post;
  376. ?>
  377. <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
  378. <article id="comment-<?php comment_ID(); ?>" class="comment">
  379. <header class="comment-meta comment-author vcard">
  380. <?php
  381. echo get_avatar( $comment, 44 );
  382. printf( '<cite><b class="fn">%1$s</b> %2$s</cite>',
  383. get_comment_author_link(),
  384. // If current post author is also comment author, make it known visually.
  385. ( $comment->user_id === $post->post_author ) ? '<span>' . __( 'Post author', 'twentytwelve' ) . '</span>' : ''
  386. );
  387. printf( '<a href="%1$s"><time datetime="%2$s">%3$s</time></a>',
  388. esc_url( get_comment_link( $comment->comment_ID ) ),
  389. get_comment_time( 'c' ),
  390. /* translators: 1: date, 2: time */
  391. sprintf( __( '%1$s at %2$s', 'twentytwelve' ), get_comment_date(), get_comment_time() )
  392. );
  393. ?>
  394. </header><!-- .comment-meta -->
  395.  
  396. <?php if ( '0' == $comment->comment_approved ) : ?>
  397. <p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentytwelve' ); ?></p>
  398. <?php endif; ?>
  399.  
  400. <section class="comment-content comment">
  401. <?php comment_text(); ?>
  402. <?php edit_comment_link( __( 'Edit', 'twentytwelve' ), '<p class="edit-link">', '</p>' ); ?>
  403. </section><!-- .comment-content -->
  404.  
  405. <div class="reply">
  406. <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'twentytwelve' ), 'after' => ' <span>&darr;</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
  407. </div><!-- .reply -->
  408. </article><!-- #comment-## -->
  409. <?php
  410. break;
  411. endswitch; // end comment_type check
  412. }
  413. endif;
  414.  
  415. if ( ! function_exists( 'twentytwelve_entry_meta' ) ) :
  416. /**
  417. * Set up post entry meta.
  418. *
  419. * Prints HTML with meta information for current post: categories, tags, permalink, author, and date.
  420. *
  421. * Create your own twentytwelve_entry_meta() to override in a child theme.
  422. *
  423. * @since Twenty Twelve 1.0
  424. *
  425. * @return void
  426. */
  427. function twentytwelve_entry_meta() {
  428. // Translators: used between list items, there is a space after the comma.
  429. $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
  430.  
  431. // Translators: used between list items, there is a space after the comma.
  432. $tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );
  433.  
  434. $date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
  435. esc_url( get_permalink() ),
  436. esc_attr( get_the_time() ),
  437. esc_attr( get_the_date( 'c' ) ),
  438. esc_html( get_the_date() )
  439. );
  440.  
  441. $author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
  442. esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
  443. esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),
  444. get_the_author()
  445. );
  446.  
  447. // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.
  448. if ( $tag_list ) {
  449. $utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
  450. } elseif ( $categories_list ) {
  451. $utility_text = __( 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
  452. } else {
  453. $utility_text = __( 'This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
  454. }
  455.  
  456. printf(
  457. $utility_text,
  458. $categories_list,
  459. $tag_list,
  460. $date,
  461. $author
  462. );
  463. }
  464. endif;
  465.  
  466. /**
  467. * Extend the default WordPress body classes.
  468. *
  469. * Extends the default WordPress body class to denote:
  470. * 1. Using a full-width layout, when no active widgets in the sidebar
  471. * or full-width template.
  472. * 2. Front Page template: thumbnail in use and number of sidebars for
  473. * widget areas.
  474. * 3. White or empty background color to change the layout and spacing.
  475. * 4. Custom fonts enabled.
  476. * 5. Single or multiple authors.
  477. *
  478. * @since Twenty Twelve 1.0
  479. *
  480. * @param array $classes Existing class values.
  481. * @return array Filtered class values.
  482. */
  483. function twentytwelve_body_class( $classes ) {
  484. $background_color = get_background_color();
  485. $background_image = get_background_image();
  486.  
  487. if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) )
  488. $classes[] = 'full-width';
  489.  
  490. if ( is_page_template( 'page-templates/front-page.php' ) ) {
  491. $classes[] = 'template-front-page';
  492. if ( has_post_thumbnail() )
  493. $classes[] = 'has-post-thumbnail';
  494. if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) )
  495. $classes[] = 'two-sidebars';
  496. }
  497.  
  498. if ( empty( $background_image ) ) {
  499. if ( empty( $background_color ) )
  500. $classes[] = 'custom-background-empty';
  501. elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) )
  502. $classes[] = 'custom-background-white';
  503. }
  504.  
  505. // Enable custom font class only if the font CSS is queued to load.
  506. if ( wp_style_is( 'twentytwelve-fonts', 'queue' ) )
  507. $classes[] = 'custom-font-enabled';
  508.  
  509. if ( ! is_multi_author() )
  510. $classes[] = 'single-author';
  511.  
  512. return $classes;
  513. }
  514. add_filter( 'body_class', 'twentytwelve_body_class' );
  515.  
  516. /**
  517. * Adjust content width in certain contexts.
  518. *
  519. * Adjusts content_width value for full-width and single image attachment
  520. * templates, and when there are no active widgets in the sidebar.
  521. *
  522. * @since Twenty Twelve 1.0
  523. *
  524. * @return void
  525. */
  526. function twentytwelve_content_width() {
  527. if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) {
  528. global $content_width;
  529. $content_width = 960;
  530. }
  531. }
  532. add_action( 'template_redirect', 'twentytwelve_content_width' );
  533.  
  534. /**
  535. * Register postMessage support.
  536. *
  537. * Add postMessage support for site title and description for the Customizer.
  538. *
  539. * @since Twenty Twelve 1.0
  540. *
  541. * @param WP_Customize_Manager $wp_customize Customizer object.
  542. * @return void
  543. */
  544. function twentytwelve_customize_register( $wp_customize ) {
  545. $wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
  546. $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
  547. $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
  548. }
  549. add_action( 'customize_register', 'twentytwelve_customize_register' );
  550.  
  551. /**
  552. * Enqueue Javascript postMessage handlers for the Customizer.
  553. *
  554. * Binds JS handlers to make the Customizer preview reload changes asynchronously.
  555. *
  556. * @since Twenty Twelve 1.0
  557. *
  558. * @return void
  559. */
  560. function twentytwelve_customize_preview_js() {
  561. wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130301', true );
  562. }
  563. add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' );
Advertisement
Add Comment
Please, Sign In to add comment