Skip to content

Instantly share code, notes, and snippets.

View hirejordansmith's full-sized avatar

Jordan Smith hirejordansmith

View GitHub Profile
@hirejordansmith
hirejordansmith / better-woocommerce-cart-checkout-styles.css
Last active March 27, 2023 23:12
Better WooCommerce Cart and Checkout Styles
/* Woocommerce Styles */
/*
A couple things to note...
1. This code was written very specifically for my base child theme so it might not work out of the box with every theme.
I have it here mostly to share with anyone who might be looking to do the same thing I was.
2. I generally add my WooCommerce CSS overrides to a custom-woo.css file then use wp_enqueue_style() to call it
so that it enqueues after the default WooCommerce Stylesheets
@hirejordansmith
hirejordansmith / replace-woocommerce-product-tabs-with-angular-js-tabs.php
Created October 20, 2016 15:23
Replace WooCommerce Product Tabs with Angular JS Tabs
<?php
// Removes WooCommerce Product Tabs
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['description'] );
unset( $tabs['additional_information'] );
unset( $tabs['reviews'] );
@hirejordansmith
hirejordansmith / change-upsell-products-per-row-woocommerce.php
Created October 14, 2016 12:46
How to change upsell products per row for WooCommerce
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_upsells', 15 );
if ( ! function_exists( 'woocommerce_output_upsells' ) ) {
function woocommerce_output_upsells() {
woocommerce_upsell_display( 5,5 ); // Display 5 products in rows of 5
}
}
@hirejordansmith
hirejordansmith / css-bounce.css
Created October 14, 2016 09:49
CSS Animations
@-moz-keyframes bounce {
0%, 20%, 50%, 80%, 100% {
-moz-transform: translateY(0);
transform: translateY(0);
}
40% {
-moz-transform: translateY(-30px);
transform: translateY(-30px);
}
60% {
@hirejordansmith
hirejordansmith / time-based-conditional-logic-gravity-forms.php
Created September 30, 2016 08:34
How to setup time-based conditional logic for Gravity Forms
<?php
add_filter( 'gform_field_value_time', function() {
return date( 'G.i', current_time( 'timestamp' ) );
} );
@hirejordansmith
hirejordansmith / change-product-description-title-woocommerce.php
Created September 15, 2016 21:23
How to Change or Remove the Product Description Title in WooCommerce
<?php
// Change the Product Description Title
add_filter('woocommerce_product_description_heading', 'hjs_product_description_heading');
function hjs_product_description_heading() {
return __('NEW TITLE HERE', 'woocommerce');
}
// Remove the Product Description Title
add_filter('woocommerce_product_description_heading', 'hjs_product_description_heading');
@hirejordansmith
hirejordansmith / get-cart-contents-total-cost-woocommerce.php
Created September 15, 2016 18:07
How to Get Cart Contents and Total Cost with WooCommerce
<a class="cart-contents" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>">
<?php echo sprintf ( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - <?php echo WC()->cart->get_cart_total(); ?>
<i class="material-icons">shopping_cart</i>
</a>
@hirejordansmith
hirejordansmith / how-to-get-the-total-number-of-entries-for-a-gravity-form.php
Created September 12, 2016 20:18
How to get the total number of entries for a Gravity Form
<?php
$search_criteria = array();
$form_id = array(108, 109);
$start_date = date( 'Y-m-d' );
$end_date = date( 'Y-m-d' );
$search_criteria['start_date'] = $start_date;
$search_criteria['end_date'] = $end_date;
$result = GFAPI::count_entries( $form_ids, $search_criteria );
$formatted_number = number_format($result);
@hirejordansmith
hirejordansmith / simple-responsive-video-shortcode.php
Created August 30, 2016 04:46
Simple Responsive Video Shortcode
<?php
// [yvideo vid="4mEbABPtTv8" /]
add_shortcode( 'yvideo', 'hjs_do_video' );
function hjs_do_video() {
$atts = shortcode_atts( array(
'vid' => ''
), $atts, 'yvideo' );
return '<div class="embed-container"><iframe src="https://www.youtube.com/embed/' . $atts['vid'] . '" frameborder="0" allowfullscreen></iframe></div>';
@hirejordansmith
hirejordansmith / replace-ajax-spinner-with-custom-spinner.css
Created August 11, 2016 21:05
Replace AJAX Spinner with Custom Spinner
/*
hourglass.gif replaces the default AJAX spinner
http://loading.io/ <- Good place to find a new one
*/
body img.gform_ajax_spinner {
position: fixed !important;