Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2. //* Start the engine
  3. include_once( get_template_directory() . '/lib/init.php' );
  4.  
  5. //* Setup Theme
  6. include_once( get_stylesheet_directory() . '/lib/theme-defaults.php' );
  7.  
  8. //* Set Localization (do not remove)
  9. load_child_theme_textdomain( 'agency', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'agency' ) );
  10.  
  11. //* Add Image upload to WordPress Theme Customizer
  12. add_action( 'customize_register', 'agency_customizer' );
  13. function agency_customizer(){
  14.  
  15. require_once( get_stylesheet_directory() . '/lib/customize.php' );
  16.  
  17. }
  18.  
  19. //* Child theme (do not remove)
  20. define( 'CHILD_THEME_NAME', __( 'Agency Pro Theme', 'agency' ) );
  21. define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/agency/' );
  22. define( 'CHILD_THEME_VERSION', '3.1.1' );
  23.  
  24. //* Add HTML5 markup structure
  25. add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );
  26.  
  27. //* Add viewport meta tag for mobile browsers
  28. add_theme_support( 'genesis-responsive-viewport' );
  29.  
  30. //* Enqueue Scripts
  31. add_action( 'wp_enqueue_scripts', 'agency_load_scripts' );
  32. function agency_load_scripts() {
  33.  
  34. wp_enqueue_script( 'agency-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' );
  35.  
  36. wp_enqueue_style( 'dashicons' );
  37.  
  38. wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=EB+Garamond|Spinnaker', array(), CHILD_THEME_VERSION );
  39.  
  40. }
  41.  
  42. //* Enqueue Backstretch script and prepare images for loading
  43. add_action( 'wp_enqueue_scripts', 'agency_enqueue_backstretch_scripts' );
  44. function agency_enqueue_backstretch_scripts() {
  45.  
  46. $image = get_option( 'agency-backstretch-image', sprintf( '%s/images/bg.jpg', get_stylesheet_directory_uri() ) );
  47.  
  48. //* Load scripts only if custom backstretch image is being used
  49. if ( ! empty( $image ) ) {
  50.  
  51. wp_enqueue_script( 'agency-pro-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' );
  52. wp_enqueue_script( 'agency-pro-backstretch-set', get_bloginfo( 'stylesheet_directory' ).'/js/backstretch-set.js' , array( 'jquery', 'agency-pro-backstretch' ), '1.0.0' );
  53.  
  54. wp_localize_script( 'agency-pro-backstretch-set', 'BackStretchImg', array( 'src' => str_replace( 'http:', '', $image ) ) );
  55.  
  56. }
  57.  
  58. }
  59.  
  60. //* Add new image sizes
  61. add_image_size( 'home-bottom', 380, 150, TRUE );
  62. add_image_size( 'home-middle', 380, 380, TRUE );
  63.  
  64. //* Add support for custom background
  65. add_theme_support( 'custom-background' );
  66.  
  67. //* Add support for custom header
  68. add_theme_support( 'custom-header', array(
  69. 'header_image' => '',
  70. 'header-selector' => '.site-title a',
  71. 'header-text' => false,
  72. 'height' => 60,
  73. 'width' => 300,
  74. ) );
  75.  
  76. //* Add support for additional color style options
  77. add_theme_support( 'genesis-style-selector', array(
  78. 'agency-pro-blue' => __( 'Agency Pro Blue', 'agency' ),
  79. 'agency-pro-green' => __( 'Agency Pro Green', 'agency' ),
  80. 'agency-pro-orange' => __( 'Agency Pro Orange', 'agency' ),
  81. 'agency-pro-red' => __( 'Agency Pro Red', 'agency' ),
  82. ) );
  83.  
  84. //* Add support for 3-column footer widgets
  85. add_theme_support( 'genesis-footer-widgets', 3 );
  86.  
  87. //* Add Before Entry widget area to front page
  88. add_action( 'genesis_before_loop', 'agency_before_entry' );
  89. function agency_before_entry() {
  90.  
  91. if ( ! is_front_page() || get_query_var( 'paged' ) >= 2 )
  92. return;
  93.  
  94. genesis_widget_area( 'before-entry', array(
  95. 'before' => '<div class="before-entry widget-area">',
  96. 'after' => '</div>',
  97. ) );
  98.  
  99. }
  100.  
  101. //* Add support for after entry widget
  102. add_theme_support( 'genesis-after-entry-widget-area' );
  103.  
  104. //* Reposition the header
  105. remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
  106. remove_action( 'genesis_header', 'genesis_do_header' );
  107. remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );
  108. add_action( 'genesis_before', 'genesis_header_markup_open', 5 );
  109. add_action( 'genesis_before', 'genesis_do_header', 10 );
  110. add_action( 'genesis_before', 'genesis_header_markup_close', 15 );
  111.  
  112. //* Remove the site description
  113. remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
  114.  
  115. //* Reposition the secondary navigation menu
  116. remove_action( 'genesis_after_header', 'genesis_do_subnav' );
  117. add_action( 'genesis_footer', 'genesis_do_subnav', 7 );
  118.  
  119. //* Reduce the secondary navigation menu to one level depth
  120. add_filter( 'wp_nav_menu_args', 'agency_secondary_menu_args' );
  121. function agency_secondary_menu_args( $args ){
  122.  
  123. if( 'secondary' != $args['theme_location'] )
  124. return $args;
  125.  
  126. $args['depth'] = 1;
  127. return $args;
  128.  
  129. }
  130.  
  131. //* Relocate after entry widget
  132. remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' );
  133. add_action( 'genesis_after_entry', 'genesis_after_entry_widget_area', 5 );
  134.  
  135. //* Remove comment form allowed tags
  136. add_filter( 'comment_form_defaults', 'agency_remove_comment_form_allowed_tags' );
  137. function agency_remove_comment_form_allowed_tags( $defaults ) {
  138.  
  139. $defaults['comment_notes_after'] = '';
  140. return $defaults;
  141.  
  142. }
  143.  
  144. //* Register widget areas
  145. genesis_register_sidebar( array(
  146. 'id' => 'home-top',
  147. 'name' => __( 'Home Top', 'agency' ),
  148. 'description' => __( 'This is the top section of the homepage.', 'agency' ),
  149. ) );
  150. genesis_register_sidebar( array(
  151. 'id' => 'home-middle',
  152. 'name' => __( 'Home Middle', 'agency' ),
  153. 'description' => __( 'This is the middle section of the homepage.', 'agency' ),
  154. ) );
  155. genesis_register_sidebar( array(
  156. 'id' => 'home-bottom',
  157. 'name' => __( 'Home Bottom', 'agency' ),
  158. 'description' => __( 'This is the bottom section of the homepage.', 'agency' ),
  159. ) );
  160. genesis_register_sidebar( array(
  161. 'id' => 'before-entry',
  162. 'name' => __( 'Before Entry', 'agency' ),
  163. 'description' => __( 'This is the Before Entry widget area.', 'agency' ),
  164. ) );
  165.  
  166. //* Remove the entry meta in the entry footer (requires HTML5 theme support)
  167. remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
  168.  
  169. //Change the Read More on an excerpt for a post
  170. function genesischild_read_more_link() {
  171. return '... <a href="' . get_permalink() . '" class="more-link" title="Read More" >Sigue leyendo</a>';
  172. }
  173. add_filter( 'excerpt_more', 'genesischild_read_more_link' );
  174.  
  175. // Google fonts
  176. add_action( 'genesis_meta', 'wpb_add_google_fonts', 5);
  177.  
  178. function wpb_add_google_fonts() {
  179. echo '<link rel="stylesheet" type="text/css"
  180.  
  181. href="http://fonts.googleapis.com/css?family=Montserrat|Lora"
  182.  
  183. media="screen">';
  184. }
  185.  
  186. //* Customize the entire footer
  187. remove_action( 'genesis_footer', 'genesis_do_footer' );
  188. add_action( 'genesis_footer', 'sp_custom_footer' );
  189. function sp_custom_footer() {
  190. ?>
  191. <p> Copyright &copy 2014 <a href="">lanzatublog.com</a> &middot; Creamos tu blog fácil, rentable y rápido!</a></p>
  192. <?php
  193. }
  194.  
  195. //* Comments deja un comentario
  196. add_filter( 'comment_form_defaults', 'sp_comment_form_defaults' );
  197. function sp_comment_form_defaults( $defaults ) {
  198. $defaults['title_reply'] = __( 'Es tu turno de compartir lo que piensas...' );
  199. return $defaults;
  200. }