Ticket #13751: 13751.diff
| File 13751.diff, 6.3 KB (added by nacin, 3 years ago) |
|---|
-
wp-includes/theme.php
1535 1535 function _custom_background_cb() { 1536 1536 $background = get_background_image(); 1537 1537 $color = get_background_color(); 1538 if ( ! $background && !$color )1538 if ( ! $background && ! $color ) 1539 1539 return; 1540 1540 1541 switch ( get_theme_mod('background_repeat', 'repeat') ) { 1542 case 'no-repeat': 1543 $repeat = 'background-repeat: no-repeat;'; 1544 break; 1545 case 'repeat-x': 1546 $repeat = 'background-repeat: repeat-x;'; 1547 break; 1548 case 'repeat-y': 1549 $repeat = 'background-repeat: repeat-y;'; 1550 break; 1551 default: 1552 $repeat = 'background-repeat: repeat;'; 1553 } 1541 $style = $color ? "background-color: #$color;" : ''; 1554 1542 1555 switch ( get_theme_mod('background_position_x', 'left') ) { 1556 case 'center': 1557 $position = 'background-position: top center;'; 1558 break; 1559 case 'right': 1560 $position = 'background-position: top right;'; 1561 break; 1562 default: 1563 $position = 'background-position: top left;'; 1564 } 1543 if ( $background ) { 1544 $image = " background-image: url('$background');"; 1565 1545 1566 if ( 'scroll' == get_theme_mod('background_attachment', 'fixed') ) 1567 $attachment = 'background-attachment: scroll;'; 1568 else 1569 $attachment = 'background-attachment: fixed;'; 1546 $repeat = get_theme_mod( 'background_repeat', 'repeat' ); 1547 if ( ! in_array( $repeat, array( 'no-repeat', 'repeat-x', 'repeat-y', 'repeat' ) ) ) 1548 $repeat = 'repeat'; 1549 $repeat = " background-repeat: $repeat;"; 1550 1551 $position = get_theme_mod( 'background_position_x', 'left' ); 1552 if ( ! in_array( $position, array( 'center', 'right', 'left' ) ) ) 1553 $position = 'left'; 1554 $position = " background-position: top $position;"; 1555 1556 $attachment = get_theme_mod( 'background_attachment', 'scroll' ); 1557 if ( ! in_array( $attachment, array( 'fixed', 'scroll' ) ) ) 1558 $attachment = 'scroll'; 1559 $attachment = " background-attachment: $attachment;"; 1570 1560 1571 if ( !empty($background ) ) 1572 $image = "background-image: url('$background');"; 1573 else 1574 $image = ''; 1575 1576 if ( !empty($color) ) 1577 $color = "background-color: #$color;"; 1578 else 1579 $color = ''; 1561 $style .= $image . $repeat . $position . $attachment; 1562 } 1580 1563 ?> 1581 1564 <style type="text/css"> 1582 body { 1583 <?php echo $image; ?> 1584 <?php echo $color; ?> 1585 <?php echo $repeat; ?> 1586 <?php echo $position; ?> 1587 <?php echo $attachment; ?> 1588 } 1565 body { <?php echo trim( $style ); ?> } 1589 1566 </style> 1590 1567 <?php 1591 1568 } -
wp-content/themes/twentyten/functions.php
190 190 <style type="text/css"> 191 191 /* Shows the same border as on front end */ 192 192 #headimg { 193 border-bottom: 1px solid #000 000;194 border-top: 4px solid #000 000;193 border-bottom: 1px solid #000; 194 border-top: 4px solid #000; 195 195 } 196 197 /* If NO_HEADER_TEXT is false, you can style here the header text preview */ 198 #headimg #name { 199 } 200 201 #headimg #desc { 202 } 196 /* If NO_HEADER_TEXT is false, you would style the text with these selectors: 197 #headimg #name { } 198 #headimg #desc { } 199 */ 203 200 </style> 204 201 <?php 205 202 } -
wp-content/themes/twentyten/header.php
11 11 ?><!DOCTYPE html> 12 12 <html <?php language_attributes(); ?>> 13 13 <head> 14 <meta charset="<?php bloginfo( 'charset' ); ?>" /> 15 <title> 16 <?php // Returns the title based on what is being viewed 17 if ( is_single() ) { // single posts 18 single_post_title(); echo ' | '; bloginfo( 'name' ); 14 <meta charset="<?php bloginfo( 'charset' ); ?>" /> 15 <title><?php 16 // Returns the title based on what is being viewed. 19 17 // The home page or, if using a static front page, the blog posts page. 20 } elseif ( is_home() || is_front_page() ) {18 if ( is_home() || is_front_page() ) { 21 19 bloginfo( 'name' ); 22 20 if( get_bloginfo( 'description' ) ) 23 21 echo ' | ' ; bloginfo( 'description' ); 24 22 twentyten_the_page_number(); 25 } elseif ( is_page() ) { // WordPress Pages26 single_post_title( '' ); echo ' | '; bloginfo( 'name' );27 23 } elseif ( is_search() ) { // Search results 28 24 printf( __( 'Search results for %s', 'twentyten' ), '"'.get_search_query().'"' ); twentyten_the_page_number(); echo ' | '; bloginfo( 'name' ); 29 } elseif ( is_404() ) { // 404 (Not Found)30 _e( 'Not Found', 'twentyten' ); echo ' | '; bloginfo( 'name' );31 25 } else { // Otherwise: 32 wp_title( ' ' ); echo ' | '; bloginfo( 'name' ); twentyten_the_page_number();26 wp_title( '|', true, 'right' ); bloginfo( 'name' ); twentyten_the_page_number(); 33 27 } 34 ?> 35 </title> 36 <link rel="profile" href="http://gmpg.org/xfn/11" /> 37 <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> 38 <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> 28 ?></title> 29 <link rel="profile" href="http://gmpg.org/xfn/11" /> 30 <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> 31 <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> 39 32 <?php 40 33 /* We add some JavaScript to pages with the comment form 41 34 * to support sites with threaded comments (when in use). -
wp-admin/custom-background.php
281 281 <th scope="row"><?php _e( 'Attachment' ); ?></th> 282 282 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Attachment' ); ?></span></legend> 283 283 <label> 284 <input name="background-attachment" type="radio" value="scroll" <?php checked('scroll', get_theme_mod('background_attachment', ' fixed')); ?> />284 <input name="background-attachment" type="radio" value="scroll" <?php checked('scroll', get_theme_mod('background_attachment', 'scroll')); ?> /> 285 285 <?php _e('Scroll') ?> 286 286 </label> 287 287 <label> 288 <input name="background-attachment" type="radio" value="fixed" <?php checked('fixed', get_theme_mod('background_attachment', ' fixed')); ?> />288 <input name="background-attachment" type="radio" value="fixed" <?php checked('fixed', get_theme_mod('background_attachment', 'scroll')); ?> /> 289 289 <?php _e('Fixed') ?> 290 290 </label> 291 291 </fieldset></td>
