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 NUMBER OF RELATED PRODUCTS | |
* ---------------------------------------------------------------------------- | |
*/ | |
add_filter( 'woocommerce_output_related_products_args', 'mw_related_products_args' ); | |
function mw_related_products_args( $args ) { | |
$args['posts_per_page'] = 4; // 4 related products |
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
/* | |
* goes in theme functions.php or a custom plugin. Replace the image filename/path with your own :) | |
*/ | |
add_action( 'init', 'custom_fix_thumbnail' ); | |
function custom_fix_thumbnail() { | |
add_filter('woocommerce_placeholder_img', 'custom_woocommerce_placeholder_img'); | |
function custom_woocommerce_placeholder_img( $src ) { |
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
/** | |
* Limit the product types that can be added to the store | |
*/ | |
add_filter( 'product_type_selector', 'mw_custom_product_type_change', 20 ); | |
function mw_custom_product_type_change( $product_types ) { | |
$new_array = array( | |
'subscription' => $product_types['subscription'] , | |
'variable-subscription' => $product_types['variable-subscription'] , | |
); | |
// $product_types = $new_array + $product_types; |
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
var gulp = require("gulp"); | |
var sass = require("gulp-sass"); | |
var autoprefix = require("gulp-autoprefixer"); | |
var filter = require('gulp-filter'); | |
var browserSync = require('browser-sync'); | |
var reload = browserSync.reload; | |
/** | |
* Start BrowserSync | |
*/ |
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
// Standard Size Thumbnail | |
if(false === get_option("thumbnail_crop")) { | |
add_option("thumbnail_crop", "1"); } | |
else { | |
update_option("thumbnail_crop", "1"); | |
} | |
// Medium Size Thumbnail | |
if(false === get_option("medium_crop")) { | |
add_option("medium_crop", "1"); } |
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
// Color Settings | |
$color: ( | |
nav: ( | |
text: #333, | |
text-hover: #FFF, | |
bg: #FFF, | |
bg-hover: #FEF160 | |
), | |
site-footer: ( | |
title: #FFF, |
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 | |
//* Do NOT include the opening php tag | |
//* Add custom body class to the head | |
add_filter( 'body_class', 'sp_body_class' ); | |
function sp_body_class( $classes ) { | |
if ( is_category( '1' ) ) | |
$classes[] = 'custom-class'; | |
return $classes; |
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 | |
/** | |
* Get post image. | |
*/ | |
function wds_get_post_image( $size = 'thumbnail' ) { | |
// If featured image is present, use that | |
if ( has_post_thumbnail() ) { | |
return get_the_post_thumbnail( $size ); |