Skip to content

Instantly share code, notes, and snippets.

View kabbo508's full-sized avatar

Sumon Rahman Kabbo kabbo508

View GitHub Profile
@kabbo508
kabbo508 / Add this Code In Your divi theme function.php file
Created January 27, 2017 17:15
How to add extra Social Icon in the Divi Theme header and Footer ?
/**
* Loads theme settings
*
*/
if ( ! function_exists( 'et_load_core_options' ) ) {
function et_load_core_options() {
global $shortname, $$themename;
require_once get_template_directory() . esc_attr( "/options_{$shortname}.php" );
@kabbo508
kabbo508 / gist:366b748f691fe733bde2f6a636467f7c
Created October 15, 2017 17:15
Add text before regular price and sale price at the Woocommerce
function bd_rrp_sale_price_html( $price, $product ) {
if ( $product->is_on_sale() ) :
$has_sale_text = array(
'<del>' => '<del>RRP: ',
'<ins>' => '<br>Sale Price: <ins>'
);
$return_string = str_replace(array_keys( $has_sale_text ), array_values( $has_sale_text ), $price);
else :
@kabbo508
kabbo508 / gist:79289bd048c2e653c3ced3eaf3ae0f08
Created October 15, 2017 18:04
Add text before regular price only In Woocommerce
function bd_rrp_price_html( $price, $product ) {
$retun_string = 'RRP: ' . $price;
return $return_string;
}
add_filter( 'woocommerce_get_price_html', 'bd_rrp_price_html', 100, 2 );
@kabbo508
kabbo508 / gist:e643dae7a1b05b73cabc84522f055a73
Created October 15, 2017 18:05
Add text before sale price only in Woocomemrce
function bd_sale_price_html( $price, $product ) {
if ( $product->is_on_sale() ) :
$return_string = str_replace( '<ins>, '<ins><br>Sale Price: ', $price);
return $return_string;
else :
return $price;
endif;
@kabbo508
kabbo508 / gist:dd8a7b3a24fa27dfc0d6a3b525645bf8
Created October 15, 2017 18:06
Add text before the price on a product that is not on sale in Woocommerce
.amount::before {
content: 'RRP:';
margin-right: 5px;
}
@kabbo508
kabbo508 / gist:f2afce419d423db1ac1bfe56d0daa1ac
Created October 15, 2017 18:08
Add text before the sale price (ins) and before the regular price (del) In Woocommerce
del .amount::before,
ins .amount::before {
margin-right: 5px;
}
del .amount::before {
content: 'RRP:';
}
ins .amount::before {
@kabbo508
kabbo508 / gist:57bcf0e8c9b82b1b581e964537b9e0a4
Created October 15, 2017 20:34
How to Setup Fontawesome icon with CSS Content value
.element {
position: relative;
}
/*replace the content value with the
corresponding value from the list below*/
.element:before {
content: "\f000";
font-family: FontAwesome;
@kabbo508
kabbo508 / Divi Slider Height Using CSS
Created January 27, 2018 12:01
Write it theme option or child theme style.css file
/* === Begin: Set the divi slider height === */
/* Src: https://divibooster.com/changing-the-height-of-the-divi-slider/ */
/* Desktop */
.myslider .et_pb_slide .et_pb_container {
height: auto !important;
min-height: 500px !important;
}
/* Tablet */
@media only screen and (min-width: 768px) and (max-width: 980px) {
@media only screen and ( min-width:981px ) {
/* Set the slider height */
.et_pb_slider, .et_pb_slider .et_pb_container {
height: 425px !important;
}
.et_pb_slider, .et_pb_slider .et_pb_slide {
max-height: 425px;
}
.et_pb_slider .et_pb_slide_description {
position: relative;
<?php
/**
* Plugin Name: WooCommerce Remove Variation "From: $XX" Price
* Plugin URI: https://gist.github.com/kabbo508/e255daff62e5671cde55a86aa62df40f
* Description: Disable the WooCommerce variable product "From: $X" price.
* Author: Kabbo Rahman
* Author URI: http://ndscript.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify