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
//custom readmore for a specific category | |
add_filter( 'excerpt_more', 'pp_cat_more_link' ); | |
function pp_cat_more_link() { | |
if(is_category('podcasts' )){ | |
return ' <a class="more-link" href="' . get_permalink() . '">Listen Now</a>'; | |
}else{ | |
return ' <a class="more-link" href=' . get_permalink() . '">Read More...</a>'; | |
} | |
} |
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
/** Seperate freepromo products from other Items - forcing multiple carts **/ | |
add_filter( 'woocommerce_cart_shipping_packages', 'ps_two_shipping_methods_in_cart' ); | |
function ps_two_shipping_methods_in_cart( $packages ) { | |
$packages = array(); | |
$freepromo_items = array(); | |
$regular_items = array(); | |
$freeshipclass= 'freepromo'; | |
$shipto = array( | |
'country' => WC()->customer->get_shipping_country(), |
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 //You will probally need to remove this | |
function tip_meta_box(){ | |
add_meta_box('tip_box', 'Things to Remember', 'tip_callback', 'post', 'side', 'high'); | |
} | |
add_action('add_meta_boxes', 'tip_meta_box'); | |
function tip_callback($post){ | |
?> |
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
//Conditional Terms of Service | |
add_filter( 'woocommerce_checkout_show_terms' , 'syb_remove_terms' ); | |
function syb_remove_terms( $fields ) { | |
foreach ( WC()->cart->get_cart() as $item ) { | |
if ( $item['product_id'] == '401') { | |
return true; | |
} | |
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_filter( 'woocommerce_return_to_shop_redirect', 'syb_shop_redirect' ); | |
function syb_shop_redirect(){ | |
return 'https://simontbailey.com/shiftyourbrilliance/'; | |
} |
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
jQuery(document).ready(function() { | |
jQuery(".builder-module-navigation .menu").addClass("mobile-menu-hidden"); | |
jQuery(".builder-module-navigation").addClass("mobile"); | |
jQuery(".mobile-menu-hidden").before('<div class="mobile-menu">≡ Menu</div>'); | |
jQuery(".mobile-menu").click(function(){ | |
jQuery(this).next().slideToggle(); | |
}); |
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
.awac-wrapper{ | |
width: 50%; | |
display: inline-block; | |
} |
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
//Change the Product description heading | |
add_filter('woocommerce_product_description_heading', 'ps_custom_product_description_heading'); | |
function ps_custom_product_description_heading(){ | |
return __( 'Custom Product Description' ); | |
} |
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: Single {CPT} | |
*/ | |
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 ); | |
remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); | |
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 ); | |
genesis(); |
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_action('pods_api_post_save_pod_item_book', 'tht_set_home', 10, 3); | |
function tht_set_home( $pieces, $is_new_item, $id ) { | |
//get the value of the 'genre' field | |
$featured =$pieces[ 'fields' ][ 'book_featured' ][ 'value' ]; | |
$blog = get_page_by_path( 'blog' ); | |
if( $featured ){ | |
update_option( 'show_on_front', 'page' ); |