This file contains 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
// Declare WooCommerce support for your theme | |
add_theme_support( 'woocommerce' ); |
This file contains 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 | |
/** | |
* Make WooCommerce product archive obey shop page layout settings | |
*/ | |
add_filter( 'genesis_pre_get_option_site_layout', 'child_do_shop_layout' ); | |
function child_do_shop_layout( $opt ) { | |
if ( is_post_type_archive('product') ) { | |
$opt = get_post_meta( wc_get_page_id('shop'), '_genesis_layout', true); | |
return $opt; |
This file contains 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 | |
/** | |
* Taxonomies | |
* | |
* This file registers any custom taxonomies | |
* | |
* @package Core_Functionality | |
* @since 1.0.0 | |
* @link https://github.com/billerickson/Core-Functionality | |
* @author Bill Erickson <bill@billerickson.net> |
This file contains 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 | |
/* Custom message for subscription products in order complete email */ | |
add_action( 'woocommerce_email_after_order_table', 'wc_completed_email_snippet' ); | |
function wc_completed_email_snippet( $order ) { | |
$order_statuses = array( 'completed' ); // order statuses to enable the email on | |
$display_cats = array( 148, 149 ); // cat ID's of products to display the message on completed emails for | |
if( in_array( $order->status, $order_statuses ) ) | |
return; // only completed orders | |
if( !class_exists( 'WC_Subscriptions_Order' ) || !class_exists( 'WC_Subscriptions_Renewal_Order' ) ) |
This file contains 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 | |
/** | |
* Template Name: Page Builder | |
* | |
* This page template only works with Genesis child themes and works great with the | |
* Beaver Builder plugin. Learn more: http://clickwp.com/blog/beaver-builder/ | |
*/ | |
// Force full width content layout to remove sidebar |
This file contains 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 | |
/* | |
* This solution assumes you've already set up your site so that the site domain is | |
* your "normal" (non-mobile) domain, and your theme is your non-mobile theme. | |
* | |
* In short, what it does it check to see if the site is being accessed through the | |
* mobile domain. If it is, the mobile theme is used instead of the normal theme, and | |
* all links point to the mobile domain (so navigatiion doesn't take visitors to the | |
* regular domain. |
This file contains 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_shortcode( 'post_category', 'sk_post_category_shortcode' ); | |
/** | |
* Produces the first category link. | |
* | |
* Supported shortcode attributes are: | |
* after (output after link, default is empty string), | |
* before (output before link, default is 'Tagged With: '), | |
* sep (separator string between tags, default is ', '). | |
* | |
* Output passes through 'genesis_post_categories_shortcode' filter before returning. |
This file contains 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 | |
/* | |
* Manage loading of theme styles | |
*/ | |
add_action( 'after_setup_theme', 'child_load_stylesheet' ); | |
function child_load_stylesheet() { | |
// First, remove the stylesheet | |
remove_action( 'genesis_meta', 'genesis_load_stylesheet' ); |
This file contains 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 | |
//* DON'T ADD ABOVE | |
/* | |
* | |
* READ ME: | |
* I'm using Beaver Builder for page post types and I don't want that option on | |
* WooCommerce store, cart, checkout, and my account pages. I don't want the client to ask why she can't change |
This file contains 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 | |
function upload_image_metabox() { | |
echo '<p><strong>Upload image</strong></p>'; | |
echo '<input type="text" id="child_logo_url" name="' . $this->get_field_name( 'welcome-image' ) . '" value="' . esc_attr( $this->get_field_value( 'welcome-image' ) ) . '" size="50" />'; | |
echo '<input id="child_upload_logo_button" type="button" class="button" value="Upload Image" /> '; | |
?> | |