Advertisement
Guest User

Untitled

a guest
Apr 11th, 2013
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.45 KB | None | 0 0
  1. <?php
  2. /** Start the engine */
  3. require_once( get_template_directory() . '/lib/init.php' );
  4.  
  5. load_child_theme_textdomain( 'executive', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'executive' ) );
  6.  
  7. /** Child theme (do not remove) */
  8. define( 'CHILD_THEME_NAME', __( 'Executive Theme', 'executive' ) );
  9. define( 'CHILD_THEME_URL', 'http://www.studiopress.com/themes/executive' );
  10.  
  11. /** Add Viewport meta tag for mobile browsers */
  12. add_action( 'genesis_meta', 'executive_add_viewport_meta_tag' );
  13. function executive_add_viewport_meta_tag() {
  14. echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
  15. }
  16.  
  17. /** Add support for custom header */
  18. add_theme_support( 'genesis-custom-header', array(
  19. 'width' => 1140,
  20. 'height' => 100
  21. ) );
  22.  
  23. /** Add support for custom background */
  24. add_theme_support( 'custom-background' );
  25.  
  26. /** Sets Content Width */
  27. $content_width = apply_filters( 'content_width', 680, 680, 1020 );
  28.  
  29. /** Create additional color style options */
  30. add_theme_support( 'genesis-style-selector', array(
  31. 'executive-brown' => __( 'Brown', 'executive' ),
  32. 'executive-green' => __( 'Green', 'executive' ),
  33. 'executive-orange' => __( 'Orange', 'executive' ),
  34. 'executive-purple' => __( 'Purple', 'executive' ),
  35. 'executive-red' => __( 'Red', 'executive' ),
  36. 'executive-teal' => __( 'Teal', 'executive' ),
  37. ) );
  38.  
  39. /** Unregister layout settings */
  40. genesis_unregister_layout( 'content-sidebar-sidebar' );
  41. genesis_unregister_layout( 'sidebar-content-sidebar' );
  42. genesis_unregister_layout( 'sidebar-sidebar-content' );
  43.  
  44. /** Unregister secondary sidebar */
  45. unregister_sidebar( 'sidebar-alt' );
  46.  
  47. /** Add new image sizes */
  48. add_image_size( 'featured', 285, 100, TRUE );
  49. add_image_size( 'portfolio', 300, 200, TRUE );
  50. add_image_size( 'slider', 1140, 445, TRUE );
  51.  
  52. /** Remove the site description */
  53. remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
  54.  
  55. /** Relocate the post info */
  56. remove_action( 'genesis_before_post_content', 'genesis_post_info' );
  57. add_action( 'genesis_before_post_title', 'genesis_post_info' );
  58.  
  59. /** Customize the post info function */
  60. add_filter( 'genesis_post_info', 'post_info_filter' );
  61. function post_info_filter($post_info) {
  62. if (!is_page()) {
  63. $post_info = '
  64. <div class=\'date-info\'>' .
  65. __('posted on', 'executive' ) .
  66. ' [post_date format="F j, Y" before="<span class=\'date\'>" after="</span>"] ' .
  67. __('by', 'executive' ) . ' [post_author_posts_link] [post_edit]
  68. </div>
  69. <div class="comments">
  70. [post_comments]
  71. </div>';
  72. return $post_info;
  73. }
  74. }
  75.  
  76. /** Change the default comment callback */
  77. add_filter( 'genesis_comment_list_args', 'executive_comment_list_args' );
  78. function executive_comment_list_args( $args ) {
  79. $args['callback'] = 'executive_comment_callback';
  80.  
  81. return $args;
  82. }
  83.  
  84. /** Customize the comment section */
  85. function executive_comment_callback( $comment, $args, $depth ) {
  86.  
  87. $GLOBALS['comment'] = $comment; ?>
  88.  
  89. <li <?php comment_class(); ?> id="comment-<?php comment_ID() ?>">
  90.  
  91. <?php do_action( 'genesis_before_comment' ); ?>
  92.  
  93. <div class="comment-header">
  94. <div class="comment-author vcard">
  95. <?php echo get_avatar( $comment, $size = $args['avatar_size'] ); ?>
  96. <?php printf( '<cite class="fn">%s</cite> <span class="says">%s:</span>', get_comment_author_link(), apply_filters( 'comment_author_says_text', __( 'says', 'executive' ) ) ); ?>
  97. <div class="comment-meta commentmetadata">
  98. <a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><?php printf( '%1$s ' . __('at', 'executive' ) . ' %2$s', get_comment_date(), get_comment_time() ); ?></a>
  99. <?php edit_comment_link( __( 'Edit', 'executive' ), g_ent( '&bull; ' ), '' ); ?>
  100. </div><!-- end .comment-meta -->
  101. </div><!-- end .comment-author -->
  102. </div><!-- end .comment-header -->
  103.  
  104. <div class="comment-content">
  105. <?php if ($comment->comment_approved == '0') : ?>
  106. <p class="alert"><?php echo apply_filters( 'genesis_comment_awaiting_moderation', __( 'Your comment is awaiting moderation.', 'executive' ) ); ?></p>
  107. <?php endif; ?>
  108.  
  109. <?php comment_text(); ?>
  110. </div><!-- end .comment-content -->
  111.  
  112. <div class="reply">
  113. <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
  114. </div>
  115.  
  116. <?php do_action( 'genesis_after_comment' );
  117.  
  118. /** No ending </li> tag because of comment threading */
  119.  
  120. }
  121.  
  122. /** Create portfolio custom post type */
  123. add_action( 'init', 'executive_portfolio_post_type' );
  124. function executive_portfolio_post_type() {
  125. register_post_type( 'portfolio',
  126. array(
  127. 'labels' => array(
  128. 'name' => __( 'Portfolio', 'executive' ),
  129. 'singular_name' => __( 'Portfolio', 'executive' ),
  130. ),
  131. 'exclude_from_search' => true,
  132. 'has_archive' => true,
  133. 'hierarchical' => true,
  134. 'menu_icon' => get_stylesheet_directory_uri() . '/images/icons/portfolio.png',
  135. 'public' => true,
  136. 'rewrite' => array( 'slug' => 'portfolio' ),
  137. 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes', 'genesis-seo' ),
  138. )
  139. );
  140. }
  141.  
  142. /** Change the number of portfolio items to be displayed (props Bill Erickson) */
  143. add_action( 'pre_get_posts', 'executive_portfolio_items' );
  144. function executive_portfolio_items( $query ) {
  145.  
  146. if( $query->is_main_query() && !is_admin() && is_post_type_archive( 'portfolio' ) ) {
  147. $query->set( 'posts_per_page', '12' );
  148. }
  149.  
  150. }
  151.  
  152. /** Add support for 3-column footer widgets */
  153. add_theme_support( 'genesis-footer-widgets', 3 );
  154.  
  155. /** Register widget areas **/
  156. genesis_register_sidebar( array(
  157. 'id' => 'home-slider',
  158. 'name' => __( 'Home - Slider', 'executive' ),
  159. 'description' => __( 'This is the slider section on the home page.', 'executive' ),
  160. ) );
  161. genesis_register_sidebar( array(
  162. 'id' => 'home-top',
  163. 'name' => __( 'Home - Top', 'executive' ),
  164. 'description' => __( 'This is the top section of the home page.', 'executive' ),
  165. ) );
  166. genesis_register_sidebar( array(
  167. 'id' => 'home-cta',
  168. 'name' => __( 'Home - Call To Action', 'executive' ),
  169. 'description' => __( 'This is the call to action section on the home page.', 'executive' ),
  170. ) );
  171. genesis_register_sidebar( array(
  172. 'id' => 'home-middle',
  173. 'name' => __( 'Home - Middle', 'executive' ),
  174. 'description' => __( 'This is the middle section of the home page.', 'executive' ),
  175. ) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement