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 1, 2020 17:19
Electro v2 - Dequeue Dokan Fontawesome
add_action( 'wp_enqueue_scripts', 'ec_child_dequeue_scripts', 30 );
function ec_child_dequeue_scripts() {
wp_dequeue_style( 'dokan-fontawesome' );
}
@ibndawood
ibndawood / functions.php
Created April 30, 2020 17:42
MyBag - Append Search Bar to Header v1
add_filter( 'wp_nav_menu_items', 'mybag_child_search_menu_item', 10, 2 );
function mybag_child_search_menu_item( $items, $args ) {
if ( $args->theme_location === 'primary' ) {
ob_start();
mybag_get_template( 'sections/mybag-search-bar.php' );
$search_form = ob_get_clean();
$items .= '<li class="dropdown"><a href="#" data-toggle="dropdown" class="dropdown-toggle"><i class="fa fa-search"></i></a><ul class="dropdown-menu" style="width:400px"><li class="menu-item menu-item-type-post_type menu-item-object-static_block animate-dropdown header-2"><div class="yamm-content" style="padding:0">' . $search_form . '<style type="text/css">.header-2 .search-area {opacity: 1;width: 100%;right:0}</style></div></li></ul></li>';
}
@ibndawood
ibndawood / functions.php
Created April 30, 2020 17:12
WooCommerce - Change "Add to Cart" text to "Buy Now"
// To change add to cart text on single product page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_single_add_to_cart_text' );
function woocommerce_custom_single_add_to_cart_text() {
return __( 'Buy Now', 'woocommerce' );
}
// To change add to cart text on product archives(Collection) page
add_filter( 'woocommerce_product_add_to_cart_text', 'woocommerce_custom_product_add_to_cart_text' );
function woocommerce_custom_product_add_to_cart_text() {
return __( 'Buy Now', 'woocommerce' );
@ibndawood
ibndawood / style.css
Created April 30, 2020 09:38
Electro v2 - WCFM Become a Vendor link button
.wcfmmp_become_vendor_link > a {
font-size: .875rem;
border-radius: 1.571em;
padding: 1.036em 2.134em;
border-width: 0;
display: inline-block;
background-color: #333e48;
color: #fff;
margin-top: 30px;
}
@ibndawood
ibndawood / style.css
Created April 29, 2020 12:03
Custom Requirement
.dropdown-menu {
font-size: 0.875em;
}
@media (min-width: 992px) {
.yamm .yamm-content .nav-title,
.yamm .yamm-content li>a {
padding: 0;
}
}
@ibndawood
ibndawood / functions.php
Last active April 27, 2020 23:16
Front - is_account_page bug fix
function front_header_user_account() {
if ( ! is_user_logged_in() && ( function_exists( 'is_account_page' ) && is_account_page() ) ) {
return;
}
$woocommerce = function_exists( 'front_is_woocommerce_activated' ) && front_is_woocommerce_activated();
$job_manager = function_exists( 'front_is_wp_job_manager_activated' ) && front_is_wp_job_manager_activated();
$job_resume_manager = function_exists( 'front_is_wp_resume_manager_activated' ) && front_is_wp_resume_manager_activated();
$job_company_manager = function_exists( 'front_is_mas_wp_company_manager_activated' ) && front_is_mas_wp_company_manager_activated();
@ibndawood
ibndawood / functions.php
Created April 24, 2020 17:00
MyBag - Load child theme color CSS
add_filter( 'mybag_colors_url', 'mybag_child_load_child_color', 50 );
function mybag_child_load_child_color( $colors_url ) {
$colors_url = get_stylesheet_directory_uri() . '/assets/css/colors/orange.css';
return $colors_url;
}
@ibndawood
ibndawood / functions.php
Created April 23, 2020 09:29
Electro v2 - Disable Header v2 Navbar and move header Icons instead of Header Support
add_action( 'init', 'ec_child_customize_header_v2', 10 );
function ec_child_customize_header_v2() {
remove_action( 'electro_header_v2', 'electro_navbar_v2', 20 );
remove_action( 'electro_masthead_v2', 'electro_header_support', 30 );
add_action( 'electro_masthead_v2', 'electro_header_icons', 30 );
}
@ibndawood
ibndawood / functions.php
Created April 23, 2020 08:55
WooCommerce - Display "In Stock" for availability text when not managing stock
add_filter( 'woocommerce_get_availability_text', 'ec_child_display_in_stock', 10 );
function ec_child_display_in_stock( $availability ) {
if ( empty( $availability ) ) {
$availability = esc_html__( 'In Stock', 'electro' );
}
return $availability;
}
@ibndawood
ibndawood / functions.php
Created April 21, 2020 14:51
Electro v2 - Display Reviewer name above review
add_action( 'init', 'ec_child_change_review_author', 10 );
function ec_child_change_review_author() {
remove_action( 'woocommerce_review_after_comment_text', 'electro_wc_review_meta', 10 );
add_action( 'woocommerce_review_before_comment_meta', 'electro_wc_review_meta', 20 );
}