Skip to content

Instantly share code, notes, and snippets.

View ibndawood's full-sized avatar
💭
I may be slow to respond.

Kader Ibrahim S ibndawood

💭
I may be slow to respond.
View GitHub Profile
@ibndawood
ibndawood / functions.php
Created May 18, 2020 18:55
Electro v2 - Off-Canvas menu should redirect to Cart page in Checkout
function electro_header_mini_cart_icon() {
if( true === electro_get_shop_catalog_mode() ) {
return;
}
$header_cart_icon = apply_filters( 'electro_header_cart_icon', 'ec ec-shopping-bag' );
$disable_header_cart_dropdown = apply_filters( 'electro_header_cart_dropdown_disable', false );
$cart_link = '';
@ibndawood
ibndawood / functions.php
Created May 18, 2020 18:35
Jobhunt - Home v2 Jobs Block in Home v1
add_action( 'jobhunt_before_homepage_v1', 'jh_child_modify_home_v1', 20 );
function jh_child_modify_home_v1() {
remove_action( 'jobhunt_homepage_v1', 'jobhunt_home_v1_job_list_block', 40 );
add_action( 'jobhunt_homepage_v1', 'jobhunt_home_v2_job_list_block', 40 );
}
@ibndawood
ibndawood / style.css
Created May 18, 2020 07:10
Vodi - Display Video attributes as list
.video__attributes {
display: block;
margin-top: -9px;
}
.video__attributes tbody {
display: flex;
margin-left: -0.75rem;
}
@ibndawood
ibndawood / functions.php
Created May 18, 2020 05:48
Vodi - Show Video attributes in Single Video page
add_action( 'masvideos_single_video_summary', 'vodi_template_single_video_attributes', 15 );
function vodi_template_single_video_attributes() {
?><div class="single-video__attributes"><?php masvideos_display_video_attributes(); ?></div><?php
}
@ibndawood
ibndawood / functions.php
Created May 18, 2020 05:20
Electro v2 - Change the default placeholder image for Brands in Single Product
function electro_template_single_brand() {
global $product;
$product_id = electro_wc_get_product_id( $product );
$brands_tax = electro_get_brands_taxonomy();
$terms = get_the_terms( $product_id, $brands_tax );
$brand_img = '';
if ( $terms && ! is_wp_error( $terms ) ) {
@ibndawood
ibndawood / functions.php
Created May 18, 2020 05:17
Electro v2 - Do not show brand if it does not have an image
function electro_template_single_brand() {
global $product;
$product_id = electro_wc_get_product_id( $product );
$brands_tax = electro_get_brands_taxonomy();
$terms = get_the_terms( $product_id, $brands_tax );
$brand_img = '';
if ( $terms && ! is_wp_error( $terms ) ) {
@ibndawood
ibndawood / featured-jobs.sql
Created May 18, 2020 05:13
Jobhunt - SQL to insert '_featured' meta_key for all Job Listings
@ibndawood
ibndawood / functions.php
Last active January 16, 2021 14:29
Electro v2 - Load RTL flexslider from WooCommerce and dequeue WP Bakery Page Builder flexslider
add_action( 'wp_enqueue_scripts', 'ec_child_dequeue_js_composer_flexslider', PHP_INT_MAX );
function ec_child_dequeue_js_composer_flexslider() {
if ( is_rtl() && is_woocommerce_activated() ) {
wp_dequeue_script( 'flexslider' );
$flexslider = array(
'handle' => 'wc-flexslider',
'src' => plugins_url( 'assets/js/flexslider/jquery.flexslider.min.js' , WC_PLUGIN_FILE ),
'deps' => array( 'jquery' ),
@ibndawood
ibndawood / functions.php
Created May 15, 2020 20:19
Electro v2 - Cart content count custom text
function electro_header_mini_cart_icon() {
if( true === electro_get_shop_catalog_mode() ) {
return;
}
$header_cart_icon = apply_filters( 'electro_header_cart_icon', 'ec ec-shopping-bag' );
$disable_header_cart_dropdown = apply_filters( 'electro_header_cart_dropdown_disable', false );
$cart_link = '';
@ibndawood
ibndawood / functions.php
Created May 15, 2020 16:35
Jobhunt - Enable Password for registration with WooCommerce disabled
add_filter( 'jobhunt_register_user_password_enabled', '__return_true', 20 );