This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Disable Genesis Theme Customizer Redirect | |
| //* Not tested in v.3.0.0 | |
| function be_disable_genesis_customizer_redirect() { | |
| global $_genesis_admin_settings, $_genesis_admin_seo_settings; | |
| $_genesis_admin_settings->redirect_to = '/wp-admin/admin.php?page=genesis&noredirect'; | |
| $_genesis_admin_seo_settings->redirect_to = '/wp-admin/admin.php?page=seo-settings&noredirect'; | |
| } | |
| add_action( 'genesis_admin_menu', 'be_disable_genesis_customizer_redirect', 11 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Add WooCommerce cart to primary navigation Genesis | |
| */ | |
| if ( class_exists( 'WooCommerce' ) ) { | |
| add_action( 'genesis_header_right', 'genesiswoo_add_cart' ); | |
| function genesiswoo_add_cart() { | |
| echo '<div class="mini-cart">'; | |
| echo '<a href="' . WC()->cart->get_cart_url() .'"title="View Cart">'. WC()->cart->get_cart_total(). '</a>'; | |
| echo '<span class="cart-count">' . WC()->cart->cart_contents_count . '</span></div>'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'woocommerce_sale_flash', 'add_percentage_to_sale_badge', 20, 3 ); | |
| function add_percentage_to_sale_badge( $html, $post, $product ) { | |
| if( $product->is_type('variable')){ | |
| $percentages = array(); | |
| // Get all variation prices | |
| $prices = $product->get_variation_prices(); | |
| // Loop through variation prices | |
| foreach( $prices['price'] as $key => $price ){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Add Custom text for salesbadge// | |
| add_filter( 'woocommerce_sale_flash', 'wc_custom_replace_sale_text' ); | |
| function wc_custom_replace_sale_text( $html ) { | |
| return str_replace( __( 'Sale!', 'woocommerce' ), __( 'My sale text!', 'woocommerce' ), $html ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body { | |
| font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; | |
| font-weight: 300; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Breadcrumb reposition before content sidebar wrap | |
| remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' ); | |
| add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_breadcrumbs' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Example with code --> | |
| <!-- Hook--> | |
| add_action( 'wp_head', 'ga_google_analytics', 10 ); | |
| function da_google_analytics() { ?> | |
| <script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxx-x"> | |
| </script> | |
| <script> | |
| // Paste your Google Analytics tracking script here | |
| window.dataLayer = window.dataLayer || []; | |
| function gtag(){dataLayer.push(arguments);} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Better method regarding to the WordPress Codex | |
| //Example | |
| function my_google_fonts() { | |
| if (!is_admin()) { | |
| wp_register_style('google', 'https://fonts.googleapis.com/css?family=Roboto', array(), null, 'all'); | |
| wp_enqueue_style('google'); | |
| }} | |
| add_action('wp_enqueue_scripts', 'my_google_fonts'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Change text strings | |
| * | |
| * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
| */ | |
| function my_text_strings( $translated_text, $text, $domain ) { | |
| switch ( $translated_text ) { | |
| case 'Related Products' : | |
| $translated_text = __( 'Your custom text here', 'woocommerce' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ** | |
| * Change text strings | |
| * | |
| * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
| */ | |
| function my_text_strings( $translated_text, $text, $domain ) { | |
| switch ( $translated_text ) { | |
| case 'Sale!' : | |
| $translated_text = __( 'Clearance!', 'woocommerce' ); | |
| break; |