Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Akramul Hasan akramulhasan

🎯
Focusing
View GitHub Profile
View scrollToTop-script.js
jQuery(document).ready(function($){
var offset = 700;
var speed = 250;
var duration = 500;
$(window).scroll(function(){
if ($(this).scrollTop() < offset) {
$('.topbutton') .fadeOut(duration);
} else {
$('.topbutton') .fadeIn(duration);
}
View Hide product from query which has no thumbnail
add_action( 'woocommerce_product_query', 'custom_pre_get_posts_query' );
function custom_pre_get_posts_query( $query ) {
$query->set( 'meta_query', array( array(
'key' => '_thumbnail_id',
'value' => '0',
'compare' => '>'
)));
}
View Show Featured Image in Shop page