Skip to content

Instantly share code, notes, and snippets.

View mikeyarce's full-sized avatar

Mikey Arce mikeyarce

View GitHub Profile
<?php
add_action( 'storefront_before_content', 'marce_custom_slider_storefront' );
function marce_custom_slider_storefront() {
if ( is_front_page() ) {
echo do_shortcode("[metaslider id=586]");
}
else {}
}
@mikeyarce
mikeyarce / hook-below-sidebar.php
Last active August 22, 2017 22:02
Hook below the sidebar
<?php // Don't add this line if your file already has it!
add_action( 'dynamic_sidebar_after', 'add_to_bottom_of_sidebar', 10, 2);
function add_to_bottom_of_sidebar() {
echo "Hello World!";
}
@mikeyarce
mikeyarce / move-product-addon-location.php
Created September 23, 2017 19:58
Move WooCommerce Product Add-on Location
<?php
// This first removes it from `before_add_to_cart_button` and then adds it to `woocommerce_product_thumbnails`
remove_action( 'woocommerce_before_add_to_cart_button', array( $GLOBALS['Product_Addon_Display'], 'display' ), 10 );
add_action( 'woocommerce_product_thumbnails', array($GLOBALS['Product_Addon_Display'], 'display'), 15);
@mikeyarce
mikeyarce / boutique-price.css
Created November 22, 2017 21:21
Change price tag display of Boutique theme
span.price {
color: black;
background: none;
position: relative;
box-shadow: none;
}
span.price:after {
display: none;
}
@mikeyarce
mikeyarce / custom-storefront-footer-links.php
Last active November 25, 2017 20:01
Custom footer links for Storefront
@mikeyarce
mikeyarce / stripe-custom.css
Created January 12, 2018 21:14
Style the Stripe 4.X credit card fields
/* Target the Credit Card */
#stripe-card-element {
background: #ffffff !important;
padding: 10px 5px !important;
margin: 5px 0px !important;
}
/* Target the Expiry Date */
#stripe-exp-element {
background: #ffffff !important;
@mikeyarce
mikeyarce / marce_add_stripe_elements_styles.php
Last active January 31, 2018 22:14
Stripe custom elements styles
// Remove this top line if your file already has one
<?php
// Stripe provides a filter for you to add custom Stripe Elements Styling
// See full documentation from Stripe on what elements are available to be styled here:
// https://stripe.com/docs/stripe-js/reference#element-options
add_filter( 'wc_stripe_elements_styling', 'marce_add_stripe_elements_styles' );
function marce_add_stripe_elements_styles($array) {
@mikeyarce
mikeyarce / related.php
Created March 16, 2018 15:22
WooCommerce related-psosts template override for just showing one specific category of products
@mikeyarce
mikeyarce / non-relative-urls.php
Created March 26, 2018 20:00
Remove relative URLs for WooCommerce product images
<?php
/**
* Remove relative URLs for WooCommerce product images
*/
add_filter( 'woocommerce_product_get_image', function( $url, $product, $size, $attr, $placeholder, $image ) {
return $image;
}, 10, 6 );
@mikeyarce
mikeyarce / seventeen.php
Created April 17, 2018 22:22
Twenty Seventeen WooCommerce images
<?php
add_theme_support( 'woocommerce', array(
'thumbnail_image_width' => 250,
'single_image_width' => 350,
) );
}