Advertisement
bobcatou

Untitled

Jul 4th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.52 KB | None | 0 0
  1. <?php
  2. // Start the engine
  3. include_once( get_template_directory() . '/lib/init.php' );
  4.  
  5. // Child theme (do not remove)
  6. define( 'CHILD_THEME_NAME', 'Genesis Sample Theme' );
  7. define( 'CHILD_THEME_URL', 'http://www.studiopress.com/' );
  8. define( 'CHILD_THEME_VERSION', '2.2.0' );
  9.  
  10. // Enqueue Google Fonts
  11. add_action( 'wp_enqueue_scripts', 'genesis_sample_google_fonts' );
  12. function genesis_sample_google_fonts() {
  13.  
  14. wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Lato:300,400,700', array(), CHILD_THEME_VERSION );
  15.  
  16. }
  17.  
  18. // Add HTML5 markup structure
  19. add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) );
  20.  
  21. // Add Accessibility support
  22. // add_theme_support( 'genesis-accessibility', array( 'headings', 'drop-down-menu', 'search-form', 'skip-links', 'rems' ) );
  23. add_theme_support( 'genesis-accessibility', array( 'headings', 'search-form', 'skip-links', 'rems' ) );
  24.  
  25. // Add viewport meta tag for mobile browsers
  26. add_theme_support( 'genesis-responsive-viewport' );
  27.  
  28. // Add support for custom background
  29. add_theme_support( 'custom-background' );
  30.  
  31. // Add support for 3-column footer widgets
  32. add_theme_support( 'genesis-footer-widgets', 3 );
  33.  
  34. /**********************************
  35. *
  36. * Replace Header Site Title with Inline Logo
  37. *
  38. * Fixes Genesis bug - when using static front page and blog page (admin reading settings) Home page is <p> tag and Blog page is <h1> tag
  39. *
  40. * Replaces "is_home" with "is_front_page" to correctly display Home page wit <h1> tag and Blog page with <p> tag
  41. *
  42. * @author AlphaBlossom / Tony Eppright
  43. * @link http://www.alphablossom.com/a-better-wordpress-genesis-responsive-logo-header/
  44. *
  45. * @edited by Sridhar Katakam
  46. * @link http://www.sridharkatakam.com/use-inline-logo-instead-background-image-genesis/
  47. *
  48. ************************************/
  49. add_filter( 'genesis_seo_title', 'custom_header_inline_logo', 10, 3 );
  50. function custom_header_inline_logo( $title, $inside, $wrap ) {
  51.  
  52. $logo = '<img src="' . get_stylesheet_directory_uri() . '/images/logo.png" alt="' . esc_attr( get_bloginfo( 'name' ) ) . '" title="' . esc_attr( get_bloginfo( 'name' ) ) . '" width="300" height="60" />';
  53.  
  54. $inside = sprintf( '<a href="%s" title="%s">%s</a>', trailingslashit( home_url() ), esc_attr( get_bloginfo( 'name' ) ), $logo );
  55.  
  56. // Determine which wrapping tags to use - changed is_home to is_front_page to fix Genesis bug
  57. $wrap = is_front_page() && 'title' === genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : 'p';
  58.  
  59. // A little fallback, in case an SEO plugin is active - changed is_home to is_front_page to fix Genesis bug
  60. $wrap = is_front_page() && ! genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : $wrap;
  61.  
  62. // And finally, $wrap in h1 if HTML5 & semantic headings enabled
  63. $wrap = genesis_html5() && genesis_get_seo_option( 'semantic_headings' ) ? 'h1' : $wrap;
  64.  
  65. return sprintf( '<%1$s %2$s>%3$s</%1$s>', $wrap, genesis_attr( 'site-title' ), $inside );
  66.  
  67. }
  68.  
  69. // Remove the site description
  70. remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
  71.  
  72. // Enqueue scripts and styles
  73. add_action( 'wp_enqueue_scripts', 'custom_scripts_styles_mobile_responsive' );
  74. function custom_scripts_styles_mobile_responsive() {
  75.  
  76. wp_enqueue_script( 'responsive-menu', get_stylesheet_directory_uri() . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0', true );
  77. wp_enqueue_style( 'dashicons' );
  78.  
  79. }
  80.  
  81. // Customize the previous page link
  82. add_filter ( 'genesis_prev_link_text' , 'sp_previous_page_link' );
  83. function sp_previous_page_link ( $text ) {
  84. return g_ent( '&laquo; ' ) . __( 'Previous Page', CHILD_DOMAIN );
  85. }
  86.  
  87. // Customize the next page link
  88. add_filter ( 'genesis_next_link_text' , 'sp_next_page_link' );
  89. function sp_next_page_link ( $text ) {
  90. return __( 'Next Page', CHILD_DOMAIN ) . g_ent( ' &raquo; ' );
  91. }
  92.  
  93. /**
  94. * Remove Genesis Page Templates
  95. *
  96. * @author Bill Erickson
  97. * @link http://www.billerickson.net/remove-genesis-page-templates
  98. *
  99. * @param array $page_templates
  100. * @return array
  101. */
  102. function be_remove_genesis_page_templates( $page_templates ) {
  103. unset( $page_templates['page_archive.php'] );
  104. unset( $page_templates['page_blog.php'] );
  105. return $page_templates;
  106. }
  107. add_filter( 'theme_page_templates', 'be_remove_genesis_page_templates' );
  108.  
  109. /**********************************
  110. *
  111. * Listen to the Wind Media Changes
  112. *
  113. ************************************/
  114.  
  115.  
  116.  
  117. /**
  118. *Customer Support Admin Notice
  119. **/
  120.  
  121. function howdy_message($translated_text, $text, $domain) {
  122. $new_message = str_replace('Howdy', 'Call Listen to the Wind Media at 678-520-9914 if you have a question', $text);
  123. return $new_message;
  124. }
  125. add_filter('gettext', 'howdy_message', 10, 3);
  126.  
  127.  
  128. //* Customize search form input box text
  129. add_filter( 'genesis_search_text', 'sp_search_text' );
  130. function sp_search_text( $text ) {
  131. return esc_attr( 'Search our gallery' );
  132. }
  133.  
  134. //* Customize footer credits
  135. add_filter( 'genesis_footer_creds_text', 'sp_footer_creds_text' );
  136. function sp_footer_creds_text() {
  137. echo '<div class="lwm_credits"><p>';
  138. echo 'Copyright &copy; ';
  139. echo date('Y');
  140. echo ' &middot; <a href="http://bahnsengallery.com">Bahnsen Gallery</a> &middot; Built by: <a href="http://www.listentothewindmedia.com" title="Listen to the Wind Media">Listen to the Wind Media</a>';
  141. echo '</p></div>';
  142. }
  143.  
  144.  
  145. // Declare WooCommerce support for your theme using gitcode
  146. //add_theme_support( 'woocommerce' );
  147.  
  148. // Declare WooCommerce support for your theme using Genesis Connect Plugin for Woocommerce
  149. add_theme_support( 'genesis-connect-woocommerce' );
  150.  
  151. //*Disables Woo Comments
  152. add_filter( 'woocommerce_product_tabs', 'wcs_woo_remove_reviews_tab', 98 );
  153. function wcs_woo_remove_reviews_tab($tabs) {
  154. unset($tabs['reviews']);
  155. return $tabs;
  156. }
  157.  
  158. //
  159. add_filter('woocommerce_empty_price_html', 'custom_call_for_price');
  160.  
  161. function custom_call_for_price() {
  162. return 'For Pricing</br>Call (850) 258-0498 ';
  163. }
  164.  
  165. /**
  166. * Changes Title of Shop page
  167. **/
  168. add_filter( 'woocommerce_page_title', 'woo_shop_page_title');
  169.  
  170. function woo_shop_page_title( $page_title ) {
  171.  
  172. if( 'Shop' == $page_title) {
  173. return "Browse Our Artwork";
  174. }
  175. }
  176.  
  177.  
  178.  
  179. // Display 16 instead of default of 4 products per page.
  180. add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 16;' ), 20 );
  181.  
  182.  
  183.  
  184.  
  185.  
  186. //* Widget area under main display image 1 (Front page Only)
  187. genesis_register_sidebar( array(
  188. 'id' => 'lwm_featured-row1',
  189. 'name' => __( 'Full Width Area Below Display Image', 'bahnsengallery' ),
  190. 'description' => __( 'Area below display photo on homepage', 'bahnsengallery' ),
  191. ) );
  192.  
  193. //* Row 2 Widget area under main display image (Front page Only)
  194. genesis_register_sidebar( array(
  195. 'id' => 'lwm_featured-row2',
  196. 'name' => __( 'Full Width Area Below Display Image Row 2', 'bahnsengallery' ),
  197. 'description' => __( 'Second Row Area below display photo on homepage', 'bahnsengallery' ),
  198. ) );
  199.  
  200.  
  201. //* Third Row Widgets Left and Right
  202.  
  203. //* 1st Column
  204. genesis_register_sidebar( array(
  205. 'id' => 'lwm_featured-row3_left',
  206. 'name' => __( 'Row 3 - Left Side', 'sample' ),
  207. 'description' => __( 'Initial Build Coded 1/3 width', 'bahnsengallery' ),
  208. ) );
  209. //* 2nd Column
  210. genesis_register_sidebar( array(
  211. 'id' => 'lwm_featured-row3_right',
  212. 'name' => __( 'Row 3 - Right Side', 'sample' ),
  213. 'description' => __( 'Initial Build Coded 2/3 width', 'bahnsengallery' ),
  214. ) );
  215.  
  216.  
  217. // Enqueuing Equal heights jQuery for Content and Primary Sidebar (with Content-Sidebar as the default layout in Genesis settings)
  218.  
  219. //add_action( 'wp_enqueue_scripts', 'sk_equal_heights' );
  220. //function sk_equal_heights() {
  221.  
  222. // wp_enqueue_script( 'equalheights_script', get_stylesheet_directory_uri() . '/js/equal-heights.js', array('jquery'), '1.0.0' );
  223.  
  224. //}
  225.  
  226.  
  227.  
  228.  
  229. //*Gets rid of Add to Cart Button
  230.  
  231. //function remove_loop_button(){
  232. //remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
  233. //remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
  234. //}
  235. //add_action('init','remove_loop_button');
  236.  
  237.  
  238.  
  239. remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
  240. remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
  241.  
  242.  
  243. //* Add custom body class to the head
  244. add_filter( 'body_class', 'bg_shop_add_body_class' );
  245. function bg_shop_add_body_class( $classes ) {
  246. if (is_shop()) {
  247. $classes[] = 'bg-shop';
  248. }
  249. return $classes;
  250. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement