Advertisement
comprock

ChrisFord functions.php

Feb 24th, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.77 KB | None | 0 0
  1. <?php
  2. /** Start the engine */
  3. require_once( get_template_directory() . '/lib/init.php' );
  4.  
  5. /** Child theme (do not remove) */
  6. define( 'CHILD_THEME_NAME', 'Balance Theme' );
  7. define( 'CHILD_THEME_URL', 'http://www.studiopress.com/themes/balance' );
  8.  
  9. /** Create additional color style options */
  10. add_theme_support( 'genesis-style-selector', array( 'balance-blue' => 'Blue', 'balance-green' => 'Green', 'balance-turquoise' => 'Turquoise', 'balance-pink' => 'Pink' ) );
  11.  
  12. /** Add support for structural wraps */
  13. add_theme_support( 'genesis-structural-wraps', array( 'header', 'nav', 'subnav', 'inner', 'footer-widgets', 'footer' ) );
  14.  
  15. /** Add new image sizes */
  16. add_image_size( 'grid', 295, 100, TRUE );
  17. add_image_size( 'portfolio', 300, 200, TRUE );
  18.  
  19. /** Add Viewport meta tag for mobile browsers */
  20. add_action( 'genesis_meta', 'balance_viewport_meta_tag' );
  21. function balance_viewport_meta_tag() {
  22.     echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
  23. }
  24.  
  25. /** Unregister layout settings */
  26. genesis_unregister_layout( 'content-sidebar-sidebar' );
  27. genesis_unregister_layout( 'sidebar-content-sidebar' );
  28. genesis_unregister_layout( 'sidebar-sidebar-content' );
  29.  
  30. /** Add support for custom background */
  31. add_custom_background();
  32.  
  33. /** Add support for custom header */
  34. add_theme_support( 'genesis-custom-header', array( 'width' => 960, 'height' => 135 ) );
  35.  
  36. /** Reposition post info */
  37. remove_action( 'genesis_before_post_content', 'genesis_post_info' );
  38. add_action( 'genesis_before_post_title', 'genesis_post_info' );
  39.  
  40. /** Display author box on single posts */
  41. add_filter( 'get_the_author_genesis_author_box_single', '__return_true' );
  42.  
  43. /** Customize the post info function */
  44. add_filter( 'genesis_post_info', 'post_info_filter' );
  45. function post_info_filter($post_info) {
  46.     if (!is_page()) {
  47.         $post_info = '[post_author_posts_link] [post_date]';
  48.         return $post_info;
  49.     }
  50. }
  51.  
  52. /** Customize the entire footer */
  53. remove_action( 'genesis_footer', 'genesis_do_footer' );
  54. add_action( 'genesis_footer', 'custom_footer' );
  55. function custom_footer() {
  56.     ?>
  57.     <p>Β© Copyright 2004-2013 <a href="http://www.myfordassociates.com/">Ford & Associates</a></p>
  58.     <?php
  59. }
  60.  
  61. /** Customize the post meta function */
  62. add_filter( 'genesis_post_meta', 'post_meta_filter' );
  63. function post_meta_filter($post_meta) {
  64.     if (!is_page()) {
  65.         $post_meta = '[post_categories] [post_edit] [post_tags] [post_comments]';
  66.         return $post_meta;
  67.     }
  68. }
  69.  
  70. /** Customize 'Read More' text */
  71. add_filter( 'get_the_content_more_link', 'balance_read_more_link' );
  72. add_filter( 'the_content_more_link', 'balance_read_more_link' );
  73. function balance_read_more_link() {
  74.     return '<a href="' . get_permalink() . '" rel="nofollow">' . __( 'Continue Reading' ) . '</a>';
  75. }
  76.  
  77. /** Customize search button text */
  78. add_filter( 'genesis_search_button_text', 'custom_search_button_text' );
  79. function custom_search_button_text($text) {
  80.     return esc_attr('');
  81. }
  82.  
  83. /** Reposition the breadcrumbs */
  84. remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
  85. add_action( 'genesis_after_header', 'genesis_do_breadcrumbs' );
  86.  
  87. /** Customize breadcrumbs display */
  88. add_filter( 'genesis_breadcrumb_args', 'balance_breadcrumb_args' );
  89. function balance_breadcrumb_args( $args ) {
  90.     $args['home'] = 'Home';
  91.     $args['sep'] = ' ';
  92.     $args['list_sep'] = ', '; // Genesis 1.5 and later
  93.     $args['prefix'] = '<div class="breadcrumb"><div class="wrap">';
  94.     $args['suffix'] = '</div></div>';
  95.     $args['labels']['prefix'] = '<span class="home">You are here:</span>';
  96.     return $args;
  97. }
  98.  
  99. /** Add support for 3-column footer widgets */
  100. add_theme_support( 'genesis-footer-widgets', 3 );
  101.  
  102. /** Register widget areas */
  103. genesis_register_sidebar( array(
  104.     'id'                => 'home-featured-left',
  105.     'name'          => __( 'Home Featured Left', 'balance' ),
  106.     'description'   => __( 'This is the featured left area on the homepage.', 'balance' ),
  107. ) );
  108.  
  109. genesis_register_sidebar( array(
  110.     'id'                => 'home-featured-right',
  111.     'name'          => __( 'Home Featured Right', 'balance' ),
  112.     'description'   => __( 'This is the featured right area on the homepage.', 'balance' ),
  113. ) );
  114.  
  115. genesis_register_sidebar( array(
  116.     'id'                => 'portfolio',
  117.     'name'          => __( 'Portfolio', 'balance' ),
  118.     'description'   => __( 'This is the portfolio page.', 'balance' ),
  119. ) );
  120.  
  121. add_filter( 'pre_get_posts', 'pre_get_posts_allow_testimonials' );
  122. function pre_get_posts_allow_testimonials( $query ) {
  123.     if ( $query->is_admin ) {
  124.         return $query;
  125.     } elseif ( ( $query->is_main_query() || is_feed() )
  126.         && ! is_page()
  127.         && ( ( ! empty( $query->query_vars['post_type'] ) && 'post' == $query->query_vars['post_type'] )
  128.             || is_archive() )
  129.     ) {
  130.         $query->set( 'post_type', array( 'post', Testimonials_Widget::pt ) );
  131.     }
  132.  
  133.     return $query;
  134. }
  135.  
  136. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement