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 | |
// Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php). | |
// Used in conjunction with https://gist.github.com/woogists/9a16fd2d0c982e780a5de89c30cbbd25 | |
// Compatible with WooCommerce 3.0+. Thanks to Alex for assisting with an update! | |
function woocommerce_header_add_to_cart_fragment( $fragments ) { | |
global $woocommerce; | |
ob_start(); | |
?> | |
<a class="cart-customlocation" href="<?php echo esc_url(wc_get_cart_url()); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>"><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?> - <?php echo $woocommerce->cart->get_cart_total(); ?></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
<?php | |
function show_username_when_login() { | |
global $current_user; | |
if ( is_user_logged_in() ) { | |
return $current_user->display_name; | |
} else { | |
return 'Log In'; | |
} |
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
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { | |
/* IE10+ CSS styles go here */ | |
img.img-slide { | |
opacity: 0 !important; | |
} | |
} |
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
@-moz-document url-prefix() { | |
/* Firefox (all) */ | |
} | |
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { | |
/* IE10+ CSS styles go here */ | |
} | |
@supports (-ms-ime-align:auto) { | |
/* IE Edge 12+ CSS styles go here */ | |
} |
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
///in functions.php | |
<?php | |
function add_async_attribute($tag, $handle) { | |
if ( 'SCRIPT_NAME' !== $handle ) | |
return $tag; | |
return str_replace( ' src', ' async src', $tag ); | |
} | |
add_filter('script_loader_tag', 'add_async_attribute', 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
.map-responsive{ | |
overflow:hidden; | |
padding-bottom:56.25%; | |
position:relative; | |
height:0; | |
} | |
.map-responsive iframe{ | |
left:0; | |
top:0; | |
height: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
<?php | |
add_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 20 ); | |
function new_loop_shop_per_page( $cols ) { | |
// $cols contains the current number of products per page based on the value stored on Options -> Reading | |
// Return the number of products you wanna show per page. | |
$cols = 50; | |
return $cols; | |
} |
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 echo get_the_category( $post->ID )[0]->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
$('#textarea').summernote({ | |
height: 250, //set editable area's height | |
callbacks: { // it must be like this in new version | |
onImageUpload: function(files, editor, $editable) { | |
sendFile(files[0],editor,$editable); | |
} | |
} | |
}); | |
function sendFile(file,editor,welEditable) { |