Skip to content

Instantly share code, notes, and snippets.

View mikeyarce's full-sized avatar

Mikey Arce mikeyarce

View GitHub Profile
<?php // Remove this line if you already have an opening PHP tag above
add_filter( 'woo_breadcrumbs_args', 'marce_change_breadcrumb_home_text' );
function marce_change_breadcrumb_home_text( $args ) {
// Change the breadcrumb home text from 'Home' to 'Appartment'
$defaults['show_home'] = 'Casa';
return $defaults;
}
@mikeyarce
mikeyarce / align-add-to-cart-buttons.css
Created July 11, 2016 15:12
Storefront Align Add to Cart Buttons
li.type-product a:first-child {
min-height: 355px;
display: block;
}
<?php
// Remove the opening PHP tag above if your file already includes it
add_filter('gettext', 'translate_text');
add_filter('ngettext', 'translate_text');
function translate_text($translated) {
$translated = str_ireplace('Choose an option', 'Select', $translated);
$translated = str_ireplace('Original Text', 'Your Replacment Text', $translated);
return $translated;
.page-template-template-homepage-php .site-main .columns-6 ul.products li.product-category.product {
width: 15%
}
.page-template-template-homepage-php .site-main .columns-6 ul.products li.product-category.product:first-child {
width: 47.8260869565%;
}
.page-template-template-homepage-php .site-main .columns-6 ul.products li.product-category.product:nth-child(4) {
margin-right: 4.347826087%;
}
@media only screen and (min-width: 769px) {
.home .woocommerce-wrap .widget_woothemes_features .features .feature:nth-child(4n) {
clear: both;
}
.home .woocommerce-wrap .widget_woothemes_features .features .feature:nth-child(5n) {
clear: none;
}
}
@mikeyarce
mikeyarce / canvas-sub-menu.css
Last active September 9, 2016 16:18
Canvas mobile sub-menu visibility
@media screen and (max-width: 768px) {
ul.nav ul.sub-menu {
left: 0;
visibility: visible;
position: relative;
}
}
function marce_hide_storefront_credit_link( $bool ){
return false;
}
add_filter( 'storefront_credit_link', 'marce_hide_storefront_credit_link', 10, 1 );
@mikeyarce
mikeyarce / storefront-full-width-slider.php
Last active June 24, 2017 00:43
Add a full-width slider to Storefront (meta slider in example)
// Don't copy this opening PHP tag if your file already has one. That breaks things.
<?php
function marce_slider_before_storefront_content () {
// If the template is not the homepage (template-homepage.php), don't display.
if ( ! is_page_template( 'template-homepage.php' ) ) {
return false;
}
// If it is the homepage, add this meta slider shortcode
echo do_shortcode( '[metaslider id=586]');
jQuery( function( $ ) {
$(function() {
$pay_in_full = ( $('#wc-option-pay-full') );
console.log($pay_in_full.val());
if ( 'no' === $pay_in_full.val() ) {
$( '.wc-deposits-payment-plans' ).hide();
}
});
$( '.wc-deposits-wrapper' )
.on( 'change', 'input[name="wc_deposit_option"]', function() {
@mikeyarce
mikeyarce / restrict.php
Created September 28, 2016 22:43
WooCommerce Memberships restrict through template
<?php
$user_id = get_current_user_id();
if ( wc_memberships_is_user_active_member( $user_id, 'gold' ) ) {
get_template_part( 'template', 'gold' );
} else {
echo "You are not allowed to view this content";
}
?>