Skip to content

Instantly share code, notes, and snippets.

@joshrogersdesign
joshrogersdesign / wc-disable-any-repeat-purchase.php
Created June 28, 2016 22:50 — forked from bekarice/wc-disable-any-repeat-purchase.php
Disables Repeat Purchase for any WooCommerce product
<?php
/**
* Disables repeat purchase for products / variations
*
* @param bool $purchasable true if product can be purchased
* @param \WC_Product $product the WooCommerce product
* @return bool $purchasable the updated is_purchasable check
*/
function sv_disable_repeat_purchase( $purchasable, $product ) {
@joshrogersdesign
joshrogersdesign / functions.php
Last active April 27, 2016 16:12
Add SmoothScroll.js to specified WordPress page based on conditional tag
//ENQUEUE JQUERY SMOOTH SCROLL
function smoothscrollfaqs() {
if( is_page('faqs')) {
wp_enqueue_script( 'scrollToAnchor', get_stylesheet_directory_uri() . '/js/smoothscroll.js', array( 'jquery' ), '', true );
}
}
add_action( 'wp_footer', 'smoothscrollfaqs' );
@joshrogersdesign
joshrogersdesign / archive-portfolio.php
Created August 21, 2015 22:21
Swank Child Theme Sassified
<?php
//* The custom portfolio post type archive template
//* Add the portfolio blurb section
add_action( 'genesis_before_content', 'swank_portfolioblurb_before_content' );
function swank_portfolioblurb_before_content() {
genesis_widget_area( 'portfolioblurb', array(
'before' => '<div class="portfolioblurb">',