A Pen by Akshay Nair on CodePen.
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 | |
//* Enqueue scripts and styles | |
add_action( 'wp_enqueue_scripts', 'tabsalot_enqueue_scripts_styles' ); | |
function tabsalot_enqueue_scripts_styles() { | |
wp_enqueue_script( 'tabs-init' , get_stylesheet_directory_uri() . '/js/tabs-init.js', array( 'tabsjs' ), '1', true ); | |
wp_enqueue_script( 'tabsjs' , get_stylesheet_directory_uri() . '/js/jquery.responsiveTabs.js', array( 'jquery' ), '1', true ); | |
wp_enqueue_style( 'tabscss' , get_stylesheet_directory_uri() . '/css/responsive-tabs.css', array(), '1.0.0', 'all' ); | |
wp_enqueue_style( 'dashicons' ); // for the + and - on the accordions |
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 | |
//ref - http://wordpress.stackexchange.com/questions/141125/allow-html-in-excerpt/141136 | |
function wpb_excerpt_allowedtags() { | |
// Add custom tags to this string | |
return '<script>,<style>,<br>,<em>,<i>,<ul>,<ol>,<li>,<a>,<p>,<img>,<video>,<audio>'; | |
} |
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 'add to cart' text on single product page (depending on product IDs) | |
add_filter( 'woocommerce_product_single_add_to_cart_text', 'bryce_id_multiple_add_to_cart_text' ); | |
function bryce_id_multiple_add_to_cart_text( $default ) { | |
if ( get_the_ID() == 386 ) { | |
return __( 'Yes! I WANT this!', 'your-slug' ); | |
} elseif ( get_the_ID() == 125 ) { | |
return __( 'This is number 125! Add!', 'your-slug' ); | |
} elseif ( get_the_ID() == 225 ) { |
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
/** | |
* Deactivate Flat Rate Shipping if products with specific shipping | |
* classes are in the cart | |
* | |
* Add the shipping class slugs to the $shippingclass_array array | |
*/ | |
add_filter( 'woocommerce_shipping_flat_rate_is_available', 'unset_woocommerce_shipping_methods_flat_rate', 10 ,2 ); | |
function unset_woocommerce_shipping_methods_flat_rate ( $return, $package ) { | |
// Setup an array of shipping classes that do not allow Flat Rate Shipping |
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
// Some basic javascript Date examples | |
// NOTE: Javascript dates have 0 indexed months, because they are awesome | |
// January 1, 2012 (Chicago, IL) | |
var firstOfYear = new Date(2012, 0, 1), | |
// 6 Hour offset (before DST change) | |
hoursOffset = firstOfYear.getTimezoneOffset() / 60; | |
// April 1, 2012 (Chicago, IL) |