SHOW:
|
|
- or go back to the newest paste.
| 1 | <?php | |
| 2 | ||
| 3 | - | $custom_header_support = array( |
| 3 | + | /** |
| 4 | - | // The default image to use. |
| 4 | + | * |
| 5 | - | // The %s is a placeholder for the theme template directory URI. |
| 5 | + | * Digital Raindrops added |
| 6 | - | 'default-image' => '%s/images/headers/path.jpg', |
| 6 | + | * This function will run after the parents functions.php |
| 7 | - | // The height and width of our custom header. |
| 7 | + | */ |
| 8 | - | 'width' => apply_filters( 'twentyten_header_image_width', 980 ), |
| 8 | + | |
| 9 | - | 'height' => apply_filters( 'twentyten_header_image_height', 224 ), |
| 9 | + | add_action( 'after_setup_theme', 'post_theme_setup' ); |
| 10 | - | // Support flexible heights. |
| 10 | + | |
| 11 | - | 'flex-height' => true, |
| 11 | + | /** |
| 12 | - | // Don't support text inside the header image. |
| 12 | + | * Create a pluggable Function in our child theme |
| 13 | - | 'header-text' => false, |
| 13 | + | */ |
| 14 | - | // Callback for styling the header preview in the admin. |
| 14 | + | if ( !function_exists( 'post_theme_setup' ) ): |
| 15 | - | 'admin-head-callback' => 'twentyten_admin_header_style', |
| 15 | + | |
| 16 | - | ); |
| 16 | + | function post_theme_setup() {
|
| 17 | ||
| 18 | - | add_theme_support( 'custom-header', $custom_header_support ); |
| 18 | + | /* Code goes here! */ |
| 19 | ||
| 20 | - | if ( ! function_exists( 'get_custom_header' ) ) {
|
| 20 | + | // This theme uses wp_nav_menu() in one location. |
| 21 | - | // This is all for compatibility with versions of WordPress prior to 3.4. |
| 21 | + | register_nav_menus( array( |
| 22 | - | define( 'HEADER_TEXTCOLOR', '' ); |
| 22 | + | |
| 23 | - | define( 'NO_HEADER_TEXT', true ); |
| 23 | + | |
| 24 | - | define( 'HEADER_IMAGE', $custom_header_support['default-image'] ); |
| 24 | + | ) ); |
| 25 | - | define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] ); |
| 25 | + | |
| 26 | - | define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] ); |
| 26 | + | |
| 27 | - | add_custom_image_header( '', $custom_header_support['admin-head-callback'] ); |
| 27 | + | // Remove the default menu function |
| 28 | - | add_custom_background(); |
| 28 | + | function tnc_remove_default_menu() {
|
| 29 | - | } |
| 29 | + | unregister_nav_menu( 'primary' ); |
| 30 | } | |
| 31 | add_action('after_setup_theme', 'tnc_remove_default_menu', 11);
| |
| 32 | - | // This theme uses wp_nav_menu() in one location. |
| 32 | + | |
| 33 | - | register_nav_menus( array( |
| 33 | + | /** |
| 34 | * Change the header width here | |
| 35 | */ | |
| 36 | - | ) ); |
| 36 | + | add_filter( 'twentyten_header_image_width', 'my_header_width' ); |
| 37 | ||
| 38 | function my_header_width($width) {
| |
| 39 | - | // Remove the default menu function |
| 39 | + | $width = 980; |
| 40 | - | function tnc_remove_default_menu() {
|
| 40 | + | return $width; |
| 41 | - | unregister_nav_menu( 'primary' ); |
| 41 | + | } |
| 42 | ||
| 43 | /** | |
| 44 | - | add_action('after_setup_theme', 'tnc_remove_default_menu', 11);
|
| 44 | + | * Change the header width here |
| 45 | */ | |
| 46 | add_filter( 'twentyten_header_image_height', 'my_header_height' ); | |
| 47 | - | // Remove parent theme widgets by calling unregister_sidebar() |
| 47 | + | |
| 48 | - | function tnc_remove_widgets(){
|
| 48 | + | function my_header_height($height) {
|
| 49 | - | unregister_sidebar( 'fourth-footer-widget-area' ); |
| 49 | + | $height = 224; |
| 50 | - | } |
| 50 | + | return $height; |
| 51 | - | add_action( 'widgets_init', 'tnc_remove_widgets', 11 ); |
| 51 | + | } |
| 52 | ||
| 53 | // Remove the default menu function | |
| 54 | - | // Register new widgetized areas |
| 54 | + | function tnc_remove_default_menu() {
|
| 55 | - | function tnc_widgets_init() {
|
| 55 | + | unregister_nav_menu( 'primary' ); |
| 56 | } | |
| 57 | - | // Area 1a, below Area 1 to the left. |
| 57 | + | add_action('after_setup_theme', 'tnc_remove_default_menu', 11);
|
| 58 | - | register_sidebar( array( |
| 58 | + | |
| 59 | - | 'name' => __( 'Left Widget Area', 'twentyten' ), |
| 59 | + | // Remove parent theme widgets by calling unregister_sidebar() |
| 60 | - | 'id' => 'left-widget-area', |
| 60 | + | function tnc_remove_widgets(){
|
| 61 | - | 'description' => __( 'Left widget area', 'twentyten' ), |
| 61 | + | unregister_sidebar( 'fourth-footer-widget-area' ); |
| 62 | - | 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', |
| 62 | + | } |
| 63 | - | 'after_widget' => '</li>', |
| 63 | + | add_action( 'widgets_init', 'tnc_remove_widgets', 11 ); |
| 64 | - | 'before_title' => '<h3 class="widget-title">', |
| 64 | + | |
| 65 | - | 'after_title' => '</h3>', |
| 65 | + | |
| 66 | - | ) ); |
| 66 | + | // Register new widgetized areas |
| 67 | function tnc_widgets_init() {
| |
| 68 | - | // Area 1b, below Area 1 to the right. |
| 68 | + | |
| 69 | - | register_sidebar( array( |
| 69 | + | // Area 1a, below Area 1 to the left. |
| 70 | - | 'name' => __( 'Right Widget Area', 'twentyten' ), |
| 70 | + | register_sidebar( array( |
| 71 | - | 'id' => 'right-widget-area', |
| 71 | + | 'name' => __( 'Left Widget Area', 'twentyten' ), |
| 72 | - | 'description' => __( 'Right widget area', 'twentyten' ), |
| 72 | + | 'id' => 'left-widget-area', |
| 73 | - | 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', |
| 73 | + | 'description' => __( 'Left widget area', 'twentyten' ), |
| 74 | - | 'after_widget' => '</li>', |
| 74 | + | 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', |
| 75 | - | 'before_title' => '<h3 class="widget-title">', |
| 75 | + | 'after_widget' => '</li>', |
| 76 | - | 'after_title' => '</h3>', |
| 76 | + | 'before_title' => '<h3 class="widget-title">', |
| 77 | - | ) ); |
| 77 | + | 'after_title' => '</h3>', |
| 78 | ) ); | |
| 79 | ||
| 80 | // Area 1b, below Area 1 to the right. | |
| 81 | register_sidebar( array( | |
| 82 | - | /** Register sidebars by running twentyten_widgets_init() on the widgets_init hook. */ |
| 82 | + | 'name' => __( 'Right Widget Area', 'twentyten' ), |
| 83 | - | add_action( 'widgets_init', 'tnc_widgets_init' ); |
| 83 | + | 'id' => 'right-widget-area', |
| 84 | 'description' => __( 'Right widget area', 'twentyten' ), | |
| 85 | 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', | |
| 86 | - | ?> |
| 86 | + | 'after_widget' => '</li>', |
| 87 | 'before_title' => '<h3 class="widget-title">', | |
| 88 | 'after_title' => '</h3>', | |
| 89 | ) ); | |
| 90 | ||
| 91 | } | |
| 92 | /** Register sidebars by running twentyten_widgets_init() on the widgets_init hook. */ | |
| 93 | add_action( 'widgets_init', 'tnc_widgets_init' ); | |
| 94 | } | |
| 95 | endif; |