Skip to content

Instantly share code, notes, and snippets.

View zakirsajib's full-sized avatar
💭
Looking for a new challenge in 2022!

Zakir Sajib zakirsajib

💭
Looking for a new challenge in 2022!
View GitHub Profile
@zakirsajib
zakirsajib / gist:4d45e6d6b39d96f3e6de7988f3e0bf83
Created May 28, 2020 12:14
Clone from different branch instead if master
git clone -b <branch name> <repo url>
@zakirsajib
zakirsajib / table.html
Created May 31, 2020 11:22
Responsive Table
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="et">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>table</title>
<style type="text/css">
.odd { background-color: #808080; }
.generated_for_mobile { margin-bottom: 30px }
@zakirsajib
zakirsajib / gist:18ee7d433688acb7c2098242b77e34be
Created June 20, 2020 13:36
Hide related products text and entire row of releated products in WooCommerce
# There are two ways we can do this.
# Either using CSS or using remove action hook.
# Using CSS
.related.products {
display: none;
}
# Using remove action
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
@zakirsajib
zakirsajib / gist:bb48cacb8ebef3f8447d3a5660590be5
Created June 20, 2020 13:41
Make the PDP descriptions tab content fill the standard container width
# We can do it using CSS
#page .woocommerce-tabs .panel{
width: 100%;
}
@zakirsajib
zakirsajib / gist:f6c8c07625ef78a7b454fab03d868b6e
Last active June 20, 2020 15:59
Change the add to cart button color to white with 2 pixels green border
# Using CSS
.product .cart .single_add_to_cart_button{
border: 2px solid #3bb54a;
background-color: #fff;
}
@zakirsajib
zakirsajib / gist:fd6b68384c33e8c374a882aa65be7b1a
Created June 20, 2020 13:49
Hide Sale text in WooCommerce
# There are two ways we can hide Sale text
# Using CSS
.content-area .summary .onsale{
display: none;
}
# Using remove action
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 );
@zakirsajib
zakirsajib / gist:a01a74fde85e0c136f22f124d357b1bb
Created June 20, 2020 13:50
Change Dark Blue background color
# Using CSS
.shoptimizer-primary-navigation {
background-color: darkblue;
}
@zakirsajib
zakirsajib / gist:79351c53918794c0728c5ec2bd79f633
Created June 20, 2020 13:52
Hide the tag description in mobile
# Using CSS
@media screen and (max-width: 767px){
.site-branding p{
display: none;
}
}
@zakirsajib
zakirsajib / functions.php
Last active June 20, 2020 15:29
Hide header/Footer in Cart page of Storefront theme
#Using Hooks or CSS
# Code must go to functions.php of Storefront theme or its child theme
function remove_header_from_cart(){
if( is_cart() ):?>
<style>
header,
footer{
display: none;
}
@zakirsajib
zakirsajib / gist:fc549e5b1b2bde1d335d9b2d9e78a180
Last active June 21, 2020 08:12
Convert the following jQuery dependent javascript to Vanilla js.
# jQuery
$( '.post-type-archive-product #secondary' ).prepend( '<div class="close-drawer"></div>' );
# JavaScript
var drawer = document.createElement("div");
drawer.className="close-drawer"
document.querySelector('.post-type-archive-product #secondary').appendChild(drawer);