Changeset 21639
- Timestamp:
- 08/28/2012 02:18:43 AM (12 years ago)
- Location:
- trunk/wp-content/themes/twentytwelve
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentytwelve/functions.php
r21620 r21639 43 43 */ 44 44 function twentytwelve_setup() { 45 global $twentytwelve_options;46 47 45 /* 48 46 * Makes Twenty Twelve available for translation. … … 54 52 load_theme_textdomain( 'twentytwelve', get_template_directory() . '/languages' ); 55 53 56 // Load up our theme options page and related code.57 require( get_template_directory() . '/inc/theme-options.php' );58 $twentytwelve_options = new Twenty_Twelve_Options();59 60 54 // This theme styles the visual editor with editor-style.css to match the theme style. 61 55 add_editor_style(); … … 95 89 */ 96 90 function twentytwelve_scripts_styles() { 97 global $twentytwelve_options;98 99 91 /* 100 92 * Adds JavaScript to pages with the comment form to support … … 111 103 /* 112 104 * Loads our special font CSS file. 113 * Depends on Theme Options setting.114 105 */ 115 $options = $twentytwelve_options->get_theme_options(); 116 if ( $options['enable_fonts'] ) 117 wp_enqueue_style( 'twentytwelve-fonts', $twentytwelve_options->custom_fonts_url(), array(), null ); 106 $protocol = is_ssl() ? 'https' : 'http'; 107 wp_enqueue_style( 'twentytwelve-fonts', "$protocol://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700", array(), null ); 118 108 119 109 /* … … 401 391 } 402 392 add_action( 'template_redirect', 'twentytwelve_content_width' ); 393 394 /** 395 * Add postMessage support for site title and description for the Theme Customizer. 396 * 397 * @since Twenty Twelve 1.0 398 * 399 * @param WP_Customize_Manager $wp_customize Theme Customizer object. 400 * @return void 401 */ 402 function twentytwelve_customize_register( $wp_customize ) { 403 $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; 404 $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; 405 } 406 add_action( 'customize_register', 'twentytwelve_customize_register' ); 407 408 /** 409 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. 410 * 411 * @since Twenty Twelve 1.0 412 */ 413 function twentytwelve_customize_preview_js() { 414 wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20120827', true ); 415 } 416 add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' ); -
trunk/wp-content/themes/twentytwelve/js/theme-customizer.js
r21622 r21639 3 3 * 4 4 * Contains handlers to make Theme Customizer preview reload changes asynchronously. 5 * Things like fonts, site title anddescription, and background color changes.5 * Things like site title, description, and background color changes. 6 6 * 7 * See related settings in Twenty_Twelve_Options::customize_preview_js()7 * See related settings in twentytwelve_customize_preview_js() 8 8 */ 9 9 … … 21 21 } ); 22 22 23 // Custom fonts.24 wp.customize( twentytwelve_customizer.option_key + '[enable_fonts]', function( value ) {25 value.bind( function( to ) {26 if ( to ) {27 $( 'head' ).append( '<link rel="stylesheet" id="twentytwelve-fonts-css" href="' + twentytwelve_customizer.link + '" type="text/css" media="all" />' );28 } else {29 $( '#twentytwelve-fonts-css' ).remove();30 }31 } );32 } );33 34 23 // Hook into background color change and adjust body class value as needed. 35 24 wp.customize( 'background_color', function( value ) { -
trunk/wp-content/themes/twentytwelve/style.css
r21637 r21639 298 298 max-width: 100%; 299 299 } 300 .entry-content .twitter-tweet-rendered { 300 .entry-content .twitter-tweet-rendered { 301 301 max-width: 100% !important; /* Override the Twitter embed fixed width */ 302 302 }
Note: See TracChangeset
for help on using the changeset viewer.