Advertisement
Guest User

function.php

a guest
Jan 25th, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.50 KB | None | 0 0
  1. <?php
  2. /** Start the engine */
  3. require_once( TEMPLATEPATH . '/lib/init.php' );
  4. require_once( CHILD_DIR . '/lib/style.php' );
  5.  
  6. /** Child theme (do not remove) */
  7. define( 'CHILD_THEME_NAME', 'Fabric Theme' );
  8. define( 'CHILD_THEME_URL', 'http://www.studiopress.com/themes/fabric' );
  9.  
  10. $content_width = apply_filters( 'content_width', 620, 0, 920 );
  11.  
  12. /** Unregister 3-column site layouts */
  13. genesis_unregister_layout( 'content-sidebar-sidebar' );
  14. genesis_unregister_layout( 'sidebar-sidebar-content' );
  15. genesis_unregister_layout( 'sidebar-content-sidebar' );
  16.  
  17. /** Add new featured image sizes */
  18. add_image_size('featured', 650, 280, TRUE);
  19. add_image_size('sidebar', 70, 70, TRUE);
  20.  
  21. /** Add suport for custom background */
  22. add_custom_background();
  23.  
  24. /** Add support for custom header */
  25. add_theme_support( 'genesis-custom-header', array( 'width' => 960, 'height' => 100, 'textcolor' => '8f8d85', 'admin_header_callback' => 'fabric_admin_style' ) );
  26.  
  27. /**
  28. * Register a custom admin callback to display the custom header preview with the
  29. * same style as is shown on the front end.
  30. *
  31. */
  32. function fabric_admin_style() {
  33.  
  34. $headimg = sprintf( '.appearance_page_custom-header #headimg { background: url(%s) no-repeat; font-family: Georgia, Times, Times New Roman, serif; min-height: %spx; }', get_header_image(), HEADER_IMAGE_HEIGHT );
  35. $h1 = sprintf( '#headimg h1, #headimg h1 a { color: #%s; font-family: Pacifico, arial, serif; font-size: 48px; font-weight: normal; line-height: 60px; margin: 10px 0 0; text-align: center; text-decoration: none; text-shadow: #fff 1px 1px; }', esc_html( get_header_textcolor() ) );
  36. $desc = sprintf( '#headimg #desc { color: #%s; font-family: Georgia, Times, Times New Roman, serif; font-size: 14px; font-style: italic; text-align: center; text-shadow: #fff 1px 1px; }', esc_html( get_header_textcolor() ) );
  37.  
  38. printf( '<style type="text/css">%1$s %2$s %3$s</style>', $headimg, $h1, $desc );
  39.  
  40. }
  41.  
  42.  
  43.  
  44. /** Add top section to inner */
  45. add_action('genesis_after_header', 'fabric_inner_top', 20 );
  46. function fabric_inner_top() {
  47. echo '<div id="inner-top"></div>';
  48. }
  49.  
  50. /** Reposition breadcrumb */
  51. remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
  52. add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_breadcrumbs' );
  53.  
  54. /** Add custom field above post title */
  55. add_action('genesis_before_post_title', 'fabric_post_image', 8 );
  56. function fabric_post_image() {
  57.  
  58. if ( is_page() ) return;
  59.  
  60. if ( $image = genesis_get_image( 'format=url&size=featured' ) ) {
  61. printf( '<a href="%s" rel="bookmark"><img class="post-photo" src="%s" alt="%s" /></a>', get_permalink(), $image, the_title_attribute( 'echo=0' ) );
  62. }
  63.  
  64. }
  65.  
  66. /** Customize the post info function */
  67. add_filter('genesis_post_info', 'fabric_post_info_filter');
  68. function fabric_post_info_filter($post_info) {
  69. return '[post_date] by [post_author_posts_link] &middot; [post_comments] [post_edit]';
  70. }
  71.  
  72. /** Add support for 3-column footer widgets */
  73. add_theme_support( 'genesis-footer-widgets', 3 );
  74.  
  75. /** Add top section to footer widgets */
  76. add_action('genesis_before_footer', 'fabric_footer_widgets_top', 1 );
  77. function fabric_footer_widgets_top() {
  78.  
  79. if ( is_active_sidebar( 'footer-1' ) || is_active_sidebar( 'footer-2' ) || is_active_sidebar( 'footer-3' ) ) {
  80. echo '<div id="footer-widgets-top"></div>';
  81. }
  82.  
  83. }
  84.  
  85. /** Customizes go to top text */
  86. add_filter('genesis_footer_backtotop_text', 'footer_backtotop_filter');
  87. function footer_backtotop_filter($backtotop) {
  88. return '[footer_backtotop text="Top"]';
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement