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 | |
//* 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 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 | |
add_filter( 'fl_builder_settings_form_defaults', 'wpbw_default_color_button_module', 20, 2 ); | |
function wpbw_default_color_button_module( $defaults, $type ) | |
{ | |
if( $type == "button-module" ) | |
{ | |
$defaults->bg_color = "f59120"; | |
$defaults->bg_hover_color = "808080"; | |
$defaults->text_color = "ffffff"; |
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 | |
/* | |
* 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 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_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 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 | |
/* | |
* 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 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 | |
/** | |
* 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 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
// Declare WooCommerce support for your theme | |
add_theme_support( '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
.rp4wp-related-posts:after, | |
.rp4wp-related-posts ul:after { | |
clear: both; | |
content: ""; | |
display: table; | |
} | |
.rp4wp-related-posts > ul { | |
margin-left: 0; | |
padding-left: 0; |
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
/** | |
* Open all external links in a new window | |
*/ | |
jQuery(document).ready(function($) { | |
$('a').not('[href*="mailto:"]').each(function () { | |
var isInternalLink = new RegExp('/' + window.location.host + '/'); | |
if ( ! isInternalLink.test(this.href) ) { | |
$(this).attr('target', '_blank'); | |
} | |
}); |
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
// Declare WooCommerce support for your theme | |
add_theme_support( 'woocommerce' ); |