๐
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
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
if (window.location.href.indexOf("checkout/?add-to-cart=1375&quantity=1") > -1) { | |
titleClass = document.querySelector(".find_class_to_add_new_class"); | |
titleClass.classList.add("display-none-info"); | |
} | |
}); | |
</script> |
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
function show_loggedin_function( $atts ) { | |
global $current_user, $user_login; | |
get_currentuserinfo(); | |
add_filter('widget_text', 'do_shortcode'); | |
if ($user_login) | |
return 'Welcome ' . $current_user->display_name . '!'; | |
else | |
return '<a href="' . wp_login_url() . ' ">Login</a>'; | |
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
input[type=checkbox], | |
input[type=radio] { | |
width: auto; | |
flex: 0 0 16px; | |
} |
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
/* OR you can use singular_name instead of name like: */ | |
add_filter( 'woocommerce_dropdown_variation_attribute_options_args', 'filter_dropdown_variation_args', 10 ); | |
function filter_dropdown_variation_args( $args ) { | |
$args['show_option_none'] = apply_filters( 'the_title', get_taxonomy( $args['attribute'] )->labels->singular_name ); | |
return $args; | |
} |
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 | |
// before addto cart, only allow 1 item in a cart | |
add_filter( 'woocommerce_add_to_cart_validation', 'woo_custom_add_to_cart_before' ); | |
function woo_custom_add_to_cart_before( $cart_item_data ) { | |
global $woocommerce; | |
$woocommerce->cart->empty_cart(); | |
// Do nothing with the data and return | |
return true; | |
} |
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
function custom_single_product_image_html( $html, $post_id ) { | |
$post_thumbnail_id = get_post_thumbnail_id( $post_id ); | |
return get_the_post_thumbnail( $post_thumbnail_id, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ) ); | |
} | |
add_filter('woocommerce_single_product_image_thumbnail_html', 'custom_single_product_image_html', 10, 2); |
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
function remove_image_zoom_support() { | |
remove_theme_support( 'wc-product-gallery-zoom' ); | |
} | |
add_action( 'wp', 'remove_image_zoom_support', 100 ); |
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
# Create a Popup | |
1. Create a standard Elementor Popup | |
2. Set the Display Conditions for the pages you want to use it on | |
3. Take a note of the Popup ID | |
# JavaScript Code | |
1. In this example add an HTML Widget to the page | |
2. Copy and paste the code below into the Widget | |
3. Change the "popupId" constant you the ID of your |
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_action( 'elementor/widget/posts/skins_init',function($widget) { | |
class change_meta_data extends \ElementorPro\Modules\Posts\Skins\Skin_Cards { | |
public function get_id() { | |
return 'cards'; | |
} | |
public function get_title() { | |
return esc_html__( 'Card', 'elementor-pro' ); | |
} |
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_filter( 'single_template', 'update_view_counter' ); | |
function update_view_counter( $single_template ) { | |
global $post; | |
$old_count = get_post_meta( $post->ID, 'sk_view_counter', true ); | |
update_post_meta($post->ID, 'sk_view_counter', ($old_count+1)); | |
return $single_template; | |
} |