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
| // Accordion | |
| // ************************ | |
| .accordion-item{ | |
| .accordion-title{ | |
| border-bottom: 1px solid; | |
| padding: 15px 15px 10px; | |
| background: rgba(218,217,234,1); | |
| cursor: pointer; | |
| transition: all 0.3s ease-in-out; | |
| &:hover{ |
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 | |
| // ========================================================================= | |
| // Hide Free Shipping Notice of Current User is WholeSale Customer | |
| // ========================================================================= | |
| function free_shipping_cart_notification() { | |
| $wholesaler = false; | |
| // Get current user role | |
| global $current_user; |
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
| <div class="h-divider"> | |
| <div class="shadow"></div> | |
| </div> | |
| <style> | |
| .h-divider { | |
| margin: 80px auto 40px; | |
| width: 80%; | |
| position: relative; | |
| } |
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 | |
| // ============================================================= | |
| // Add Custom Fields to Rest API | |
| // ============================================================= | |
| function add_rest_api_custom_fields() { | |
| register_rest_field('post', 'authorName', array( | |
| 'get_callback' => function() {return get_the_author();} | |
| )); | |
| register_rest_field('post', 'yourCustomField', array( | |
| 'get_callback' => function() {return get_field('custom-field-name');} |
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 | |
| // args | |
| $args = array( | |
| 'numberposts' => -1, | |
| 'post_type' => 'YOUR_POST_TYPE', | |
| 'meta_query' => array( | |
| 'relation' => 'AND', | |
| array( | |
| 'key' => 'YOUR_ACF_SLUG', |
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 | |
| // ========================================================================= | |
| // Unset Specific Shipping Method if Free Shipping is Available | |
| // ========================================================================= | |
| function unset_shipping_when_free_is_available_in_zone( $rates, $package ) { | |
| // Only unset rates if free_shipping is available | |
| if ( isset( $rates['free_shipping:8'] ) ) { | |
| unset( $rates['flat_rate:1'] ); | |
| } | |
| return $rates; |
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
| // ========================================================================= | |
| // Unset Shipping Methods if Free Shipping is Available | |
| // ========================================================================= | |
| function unset_shipping_when_free_is_available_all_zones( $rates, $package ) { | |
| $all_free_rates = array(); | |
| foreach ( $rates as $rate_id => $rate ) { | |
| if ( 'free_shipping' === $rate->method_id ) { | |
| $all_free_rates[ $rate_id ] = $rate; | |
| break; | |
| } |
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 | |
| // ========================================================================= | |
| // WooCommerce add fee to checkout for a gateway ID | |
| // ========================================================================= | |
| function add_checkout_fee_for_gateway() { | |
| // Check if specific shipping zone in the cart | |
| $shipping_class_target = 32; // shipping class ID | |
| $in_cart = false; |
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 | |
| // ========================================================================= | |
| // ADD CLASS TO EXCERPT | |
| // ========================================================================= | |
| function add_class_to_excerpt ($post_excerpt) { | |
| $post_excerpt = '<p class="whatever">' . $post_excerpt . '</p>'; | |
| return $post_excerpt; | |
| } | |
| add_filter ('get_the_excerpt','add_class_to_excerpt'); |