Advertisement
Guest User

Untitled

a guest
May 12th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.02 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', 'eleven40 theme' );
  7. define( 'CHILD_THEME_URL', 'http://www.studiopress.com/themes/eleven40' );
  8.  
  9. /** Add Viewport meta tag for mobile browsers */
  10. add_action( 'genesis_meta', 'eleven40_viewport_meta_tag' );
  11. function eleven40_viewport_meta_tag() {
  12. echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
  13. }
  14.  
  15. /** Add new image sizes */
  16. add_image_size( 'grid-thumbnail', 270, 100, TRUE );
  17.  
  18. /** Create additional color style options */
  19. add_theme_support( 'genesis-style-selector', array(
  20. 'eleven40-blue' => 'Blue',
  21. 'eleven40-green' => 'Green',
  22. 'eleven40-red' => 'Red'
  23. ) );
  24.  
  25. /** Add support for structural wraps */
  26. add_theme_support( 'genesis-structural-wraps', array(
  27. 'header',
  28. 'nav',
  29. 'subnav',
  30. 'inner',
  31. 'footer-widgets',
  32. 'footer'
  33. ) );
  34.  
  35. /** Add the page title section */
  36. add_action( 'genesis_before_content_sidebar_wrap', 'eleven40_page_title' );
  37. function eleven40_page_title() {
  38. genesis_widget_area( 'page-title', array(
  39. 'before' => '<div class="page-title widget-area">',
  40. ) );
  41. }
  42.  
  43. /** Add the after post section */
  44. add_action( 'genesis_after_post_content', 'eleven40_after_post' );
  45. function eleven40_after_post() {
  46. if ( ! is_singular( 'post' ) )
  47. return;
  48. genesis_widget_area( 'after-post', array(
  49. 'before' => '<div class="after-post widget-area">',
  50. ) );
  51. }
  52.  
  53. /** Add 3-column footer widgets */
  54. add_theme_support( 'genesis-footer-widgets', 3 );
  55.  
  56. /** Register widget areas */
  57. genesis_register_sidebar( array(
  58. 'id' => 'page-title',
  59. 'name' => __( 'Page Title', 'eleven40' ),
  60. 'description' => __( 'This is the page title section.', 'eleven40' ),
  61. ) );
  62. genesis_register_sidebar( array(
  63. 'id' => 'after-post',
  64. 'name' => __( 'After Post', 'eleven40' ),
  65. 'description' => __( 'This is the after post section.', 'eleven40' ),
  66. ) );
  67.  
  68. /** Modify the Genesis content limit read more link */
  69. add_filter( 'the_content_more_link', 'custom_read_more_link' );
  70. add_filter( 'get_the_content_more_link', 'custom_read_more_link' );
  71. function custom_read_more_link() {
  72. return ' . . . <a class="more-link" href="' . get_permalink() . '">(More)</a>';
  73. }
  74.  
  75. /** Customize the next page link */
  76. add_filter ( 'genesis_next_link_text' , 'custom_next_link_text' );
  77. function custom_next_link_text ( $text ) {
  78. return g_ent( '&raquo;' ) . __( '', CHILD_DOMAIN );
  79. }
  80.  
  81. /** Customize the previous page link */
  82. add_filter ( 'genesis_prev_link_text' , 'custom_prev_link_text' );
  83. function custom_prev_link_text ( $text ) {
  84. return g_ent( '&laquo;' ) . __( '', CHILD_DOMAIN );
  85. }
  86.  
  87. /** Customize the comment submit button text */
  88. add_filter( 'genesis_comment_form_args', 'custom_comment_submit_button' );
  89. function custom_comment_submit_button( $args ) {
  90. $args['label_submit'] = __( 'Send to the Moose', 'apparition' );
  91. return $args;
  92. }
  93.  
  94. /** Modify the comment link text */
  95. add_filter( 'genesis_post_info', 'post_info_filter' );
  96. function post_info_filter( $post_info ) {
  97. return '[post_comments zero="Comment" one="1 Comment" more="% Comments"]';
  98. }
  99.  
  100. /** Customize the post meta function */
  101. add_filter( 'genesis_post_meta', 'post_meta_filter' );
  102. function post_meta_filter($post_meta) {
  103. if ( !is_page() ) {
  104. $post_meta = '[post_categories before=""] [post_tags before="Tagged: "]';
  105. return $post_meta;
  106. }}
  107.  
  108. /** Customize the comments avatar size */
  109. add_filter( 'genesis_comment_list_args', 'childtheme_comment_list_args' );
  110. function childtheme_comment_list_args( $args ) {
  111. $args['avatar_size'] = 85;
  112. return $args;
  113. }
  114.  
  115. /** Social sharing function */
  116. add_action( 'genesis_after_post_content', 'child_social_media_icons', 5 );
  117. function child_social_media_icons() {
  118. if ( is_home() || is_single() ) {
  119.  
  120. if ( get_query_var( 'paged' ) >= 2 )
  121. return;
  122. ?>
  123. <div class="share-love">
  124. <div class="facebook"><a href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>" title="Share on Facebook.">Facebook</a></div>
  125. <div class="google"><a href="https://plus.google.com/share?url=<?php the_permalink(); ?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">Google+</a></div>
  126. <div class="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&media=<?php $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); echo $url; ?>">Pinterest</a></div>
  127. <div class="stumble"><a href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>" title="Stumble it">Stumble</a></div>
  128. <div class="twitter"><a href="http://twitter.com/home/?status=<?php the_title(); ?> - <?php the_permalink(); ?>" title="Tweet this!">Twitter</a></div>
  129. </div>
  130. <?php } }
  131.  
  132. /** Remove Twitter Pro Hashtag Links */
  133. function range_no_hashtag_links() {
  134. $wpTwitterWidget = wpTwitterWidget::getInstance();
  135. remove_filter( 'widget_twitter_content', array( $wpTwitterWidget, 'linkHashtags' ) );
  136. }
  137. add_action( 'init', 'range_no_hashtag_links' );
  138.  
  139. /** Custom Widget */
  140. // Register Custom Widget
  141. genesis_register_sidebar( array(
  142. 'id' => 'custom-widget',
  143. 'name' => __( 'Custom Widget', 'eleven40' ),
  144. 'description' => __( 'Displays Custom Widget Content Home & Archive Pages', 'eleven40' ),
  145. ) );
  146.  
  147. // Hook In Custom Widget
  148. add_action( 'genesis_after_post_content', 'wpsites_custom_widget', 9 );
  149. /**
  150. * @author Brad Dalton
  151. * @link http://wpsites.net/
  152. */
  153. function wpsites_custom_widget() {
  154. if ( is_home() || is_single() ) {
  155.  
  156. if ( get_query_var( 'paged' ) >= 2 )
  157. return;
  158.  
  159. echo '<div class="custom-widget"><div class="wrap">';
  160. dynamic_sidebar( 'custom-widget' );
  161. echo '</div></div>';
  162. }
  163. }
  164.  
  165. /** Customize the post info function */
  166. add_filter( 'genesis_post_info', 'post_info_filter' );
  167. function post_info_filter($post_info) {
  168. if ( !is_page() ) {
  169. $post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]';
  170. return $post_info;
  171. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement