Advertisement
shepme

functions.php

Jun 30th, 2012
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  1. <?php
  2.  
  3. $custom_header_support = array(
  4. // The default image to use.
  5. // The %s is a placeholder for the theme template directory URI.
  6. 'default-image' => '%s/images/headers/path.jpg',
  7. // The height and width of our custom header.
  8. 'width' => apply_filters( 'twentyten_header_image_width', 980 ),
  9. 'height' => apply_filters( 'twentyten_header_image_height', 224 ),
  10. // Support flexible heights.
  11. 'flex-height' => true,
  12. // Don't support text inside the header image.
  13. 'header-text' => false,
  14. // Callback for styling the header preview in the admin.
  15. 'admin-head-callback' => 'twentyten_admin_header_style',
  16. );
  17.  
  18. add_theme_support( 'custom-header', $custom_header_support );
  19.  
  20. if ( ! function_exists( 'get_custom_header' ) ) {
  21. // This is all for compatibility with versions of WordPress prior to 3.4.
  22. define( 'HEADER_TEXTCOLOR', '' );
  23. define( 'NO_HEADER_TEXT', true );
  24. define( 'HEADER_IMAGE', $custom_header_support['default-image'] );
  25. define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] );
  26. define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] );
  27. add_custom_image_header( '', $custom_header_support['admin-head-callback'] );
  28. add_custom_background();
  29. }
  30.  
  31.  
  32. // This theme uses wp_nav_menu() in one location.
  33. register_nav_menus( array(
  34. 'header' => __( 'Header Navigation', 'twentyten' ),
  35. 'footer' => __( 'Footer Navigation', 'twentyten' ),
  36. ) );
  37.  
  38.  
  39. // Remove the default menu function
  40. function tnc_remove_default_menu() {
  41. unregister_nav_menu( 'primary' );
  42. }
  43.  
  44. add_action('after_setup_theme', 'tnc_remove_default_menu', 11);
  45.  
  46.  
  47. // Remove parent theme widgets by calling unregister_sidebar()
  48. function tnc_remove_widgets(){
  49. unregister_sidebar( 'fourth-footer-widget-area' );
  50. }
  51. add_action( 'widgets_init', 'tnc_remove_widgets', 11 );
  52.  
  53.  
  54. // Register new widgetized areas
  55. function tnc_widgets_init() {
  56.  
  57. // Area 1a, below Area 1 to the left.
  58. register_sidebar( array(
  59. 'name' => __( 'Left Widget Area', 'twentyten' ),
  60. 'id' => 'left-widget-area',
  61. 'description' => __( 'Left widget area', 'twentyten' ),
  62. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
  63. 'after_widget' => '</li>',
  64. 'before_title' => '<h3 class="widget-title">',
  65. 'after_title' => '</h3>',
  66. ) );
  67.  
  68. // Area 1b, below Area 1 to the right.
  69. register_sidebar( array(
  70. 'name' => __( 'Right Widget Area', 'twentyten' ),
  71. 'id' => 'right-widget-area',
  72. 'description' => __( 'Right widget area', 'twentyten' ),
  73. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
  74. 'after_widget' => '</li>',
  75. 'before_title' => '<h3 class="widget-title">',
  76. 'after_title' => '</h3>',
  77. ) );
  78.  
  79.  
  80.  
  81. }
  82. /** Register sidebars by running twentyten_widgets_init() on the widgets_init hook. */
  83. add_action( 'widgets_init', 'tnc_widgets_init' );
  84.  
  85.  
  86. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement