photocurio

functions.php for twentyten child theme

Mar 19th, 2011
476
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     define('HEADER_TEXTCOLOR', 'ffffff');
  3.     define('HEADER_IMAGE', get_bloginfo('stylesheet_directory') . '/images/header-default.jpg');
  4.     define('HEADER_IMAGE_WIDTH', 940);
  5.     define('HEADER_IMAGE_HEIGHT', 130);
  6.  
  7.     // The site header function
  8.     function site_header_style() {
  9.         ?><style type="text/css">
  10.             div#header {
  11.                 background: url(<?php header_image(); ?>);
  12.             }
  13.         </style><?php
  14.     }
  15.  
  16.     // The admin header function
  17.     function admin_header_style() {
  18.         ?><style type="text/css">
  19.             #headimg {
  20.                 width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
  21.                 height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
  22.             }
  23.         </style><?php
  24.     }
  25.    
  26.     // Enable!
  27.     add_custom_image_header('site_header_style', 'admin_header_style');
  28.    
  29. remove_action( 'widgets_init', 'twentyten_widgets_init' ); //necessary to replace parent theme's code
  30.     function twentyten_child_widgets_init() {
  31.         register_sidebar( array(
  32.         'name' => __( 'Alt Primary Widget Area', 'twentyten' ),
  33.         'id' => 'alt-primary-widget-area',
  34.         'description' => __( 'Alt primary widget area', 'twentyten' ),
  35.         'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
  36.         'after_widget' => '</li>',
  37.         'before_title' => '<h3 class="widget-title">',
  38.         'after_title' => '</h3>',
  39.     ) );
  40. }
  41. /** Register sidebars by running twentyten_widgets_init() on the widgets_init hook. */
  42. add_action( 'widgets_init', 'twentyten_child_widgets_init' );
  43. ?>
RAW Paste Data