Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Start the engine
- include_once( get_template_directory() . '/lib/init.php' );
- // Child theme (do not remove)
- define( 'CHILD_THEME_NAME', 'Genesis Sample Theme' );
- define( 'CHILD_THEME_URL', 'http://www.studiopress.com/' );
- define( 'CHILD_THEME_VERSION', '2.2.0' );
- // Enqueue Google Fonts
- add_action( 'wp_enqueue_scripts', 'genesis_sample_google_fonts' );
- function genesis_sample_google_fonts() {
- wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Lato:300,400,700', array(), CHILD_THEME_VERSION );
- }
- // Add HTML5 markup structure
- add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) );
- // Add Accessibility support
- // add_theme_support( 'genesis-accessibility', array( 'headings', 'drop-down-menu', 'search-form', 'skip-links', 'rems' ) );
- add_theme_support( 'genesis-accessibility', array( 'headings', 'search-form', 'skip-links', 'rems' ) );
- // Add viewport meta tag for mobile browsers
- add_theme_support( 'genesis-responsive-viewport' );
- // Add support for custom background
- add_theme_support( 'custom-background' );
- // Add support for 3-column footer widgets
- add_theme_support( 'genesis-footer-widgets', 3 );
- /**********************************
- *
- * Replace Header Site Title with Inline Logo
- *
- * 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
- *
- * Replaces "is_home" with "is_front_page" to correctly display Home page wit <h1> tag and Blog page with <p> tag
- *
- * @author AlphaBlossom / Tony Eppright
- * @link http://www.alphablossom.com/a-better-wordpress-genesis-responsive-logo-header/
- *
- * @edited by Sridhar Katakam
- * @link http://www.sridharkatakam.com/use-inline-logo-instead-background-image-genesis/
- *
- ************************************/
- add_filter( 'genesis_seo_title', 'custom_header_inline_logo', 10, 3 );
- function custom_header_inline_logo( $title, $inside, $wrap ) {
- $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" />';
- $inside = sprintf( '<a href="%s" title="%s">%s</a>', trailingslashit( home_url() ), esc_attr( get_bloginfo( 'name' ) ), $logo );
- // Determine which wrapping tags to use - changed is_home to is_front_page to fix Genesis bug
- $wrap = is_front_page() && 'title' === genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : 'p';
- // A little fallback, in case an SEO plugin is active - changed is_home to is_front_page to fix Genesis bug
- $wrap = is_front_page() && ! genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : $wrap;
- // And finally, $wrap in h1 if HTML5 & semantic headings enabled
- $wrap = genesis_html5() && genesis_get_seo_option( 'semantic_headings' ) ? 'h1' : $wrap;
- return sprintf( '<%1$s %2$s>%3$s</%1$s>', $wrap, genesis_attr( 'site-title' ), $inside );
- }
- // Remove the site description
- remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
- // Enqueue scripts and styles
- add_action( 'wp_enqueue_scripts', 'custom_scripts_styles_mobile_responsive' );
- function custom_scripts_styles_mobile_responsive() {
- wp_enqueue_script( 'responsive-menu', get_stylesheet_directory_uri() . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0', true );
- wp_enqueue_style( 'dashicons' );
- }
- // Customize the previous page link
- add_filter ( 'genesis_prev_link_text' , 'sp_previous_page_link' );
- function sp_previous_page_link ( $text ) {
- return g_ent( '« ' ) . __( 'Previous Page', CHILD_DOMAIN );
- }
- // Customize the next page link
- add_filter ( 'genesis_next_link_text' , 'sp_next_page_link' );
- function sp_next_page_link ( $text ) {
- return __( 'Next Page', CHILD_DOMAIN ) . g_ent( ' » ' );
- }
- /**
- * Remove Genesis Page Templates
- *
- * @author Bill Erickson
- * @link http://www.billerickson.net/remove-genesis-page-templates
- *
- * @param array $page_templates
- * @return array
- */
- function be_remove_genesis_page_templates( $page_templates ) {
- unset( $page_templates['page_archive.php'] );
- unset( $page_templates['page_blog.php'] );
- return $page_templates;
- }
- add_filter( 'theme_page_templates', 'be_remove_genesis_page_templates' );
- /**********************************
- *
- * Listen to the Wind Media Changes
- *
- ************************************/
- /**
- *Customer Support Admin Notice
- **/
- function howdy_message($translated_text, $text, $domain) {
- $new_message = str_replace('Howdy', 'Call Listen to the Wind Media at 678-520-9914 if you have a question', $text);
- return $new_message;
- }
- add_filter('gettext', 'howdy_message', 10, 3);
- //* Customize search form input box text
- add_filter( 'genesis_search_text', 'sp_search_text' );
- function sp_search_text( $text ) {
- return esc_attr( 'Search our gallery' );
- }
- //* Customize footer credits
- add_filter( 'genesis_footer_creds_text', 'sp_footer_creds_text' );
- function sp_footer_creds_text() {
- echo '<div class="lwm_credits"><p>';
- echo 'Copyright © ';
- echo date('Y');
- echo ' · <a href="http://bahnsengallery.com">Bahnsen Gallery</a> · Built by: <a href="http://www.listentothewindmedia.com" title="Listen to the Wind Media">Listen to the Wind Media</a>';
- echo '</p></div>';
- }
- // Declare WooCommerce support for your theme using gitcode
- //add_theme_support( 'woocommerce' );
- // Declare WooCommerce support for your theme using Genesis Connect Plugin for Woocommerce
- add_theme_support( 'genesis-connect-woocommerce' );
- //*Disables Woo Comments
- add_filter( 'woocommerce_product_tabs', 'wcs_woo_remove_reviews_tab', 98 );
- function wcs_woo_remove_reviews_tab($tabs) {
- unset($tabs['reviews']);
- return $tabs;
- }
- //
- add_filter('woocommerce_empty_price_html', 'custom_call_for_price');
- function custom_call_for_price() {
- return 'For Pricing</br>Call (850) 258-0498 ';
- }
- /**
- * Changes Title of Shop page
- **/
- add_filter( 'woocommerce_page_title', 'woo_shop_page_title');
- function woo_shop_page_title( $page_title ) {
- if( 'Shop' == $page_title) {
- return "Browse Our Artwork";
- }
- }
- // Display 16 instead of default of 4 products per page.
- add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 16;' ), 20 );
- //* Widget area under main display image 1 (Front page Only)
- genesis_register_sidebar( array(
- 'id' => 'lwm_featured-row1',
- 'name' => __( 'Full Width Area Below Display Image', 'bahnsengallery' ),
- 'description' => __( 'Area below display photo on homepage', 'bahnsengallery' ),
- ) );
- //* Row 2 Widget area under main display image (Front page Only)
- genesis_register_sidebar( array(
- 'id' => 'lwm_featured-row2',
- 'name' => __( 'Full Width Area Below Display Image Row 2', 'bahnsengallery' ),
- 'description' => __( 'Second Row Area below display photo on homepage', 'bahnsengallery' ),
- ) );
- //* Third Row Widgets Left and Right
- //* 1st Column
- genesis_register_sidebar( array(
- 'id' => 'lwm_featured-row3_left',
- 'name' => __( 'Row 3 - Left Side', 'sample' ),
- 'description' => __( 'Initial Build Coded 1/3 width', 'bahnsengallery' ),
- ) );
- //* 2nd Column
- genesis_register_sidebar( array(
- 'id' => 'lwm_featured-row3_right',
- 'name' => __( 'Row 3 - Right Side', 'sample' ),
- 'description' => __( 'Initial Build Coded 2/3 width', 'bahnsengallery' ),
- ) );
- // Enqueuing Equal heights jQuery for Content and Primary Sidebar (with Content-Sidebar as the default layout in Genesis settings)
- //add_action( 'wp_enqueue_scripts', 'sk_equal_heights' );
- //function sk_equal_heights() {
- // wp_enqueue_script( 'equalheights_script', get_stylesheet_directory_uri() . '/js/equal-heights.js', array('jquery'), '1.0.0' );
- //}
- //*Gets rid of Add to Cart Button
- //function remove_loop_button(){
- //remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
- //remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
- //}
- //add_action('init','remove_loop_button');
- remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
- remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
- //* Add custom body class to the head
- add_filter( 'body_class', 'bg_shop_add_body_class' );
- function bg_shop_add_body_class( $classes ) {
- if (is_shop()) {
- $classes[] = 'bg-shop';
- }
- return $classes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement