Skip to content

Instantly share code, notes, and snippets.

@akther80
akther80 / functions.php
Created March 26, 2019 14:30
Electro v2 - Remove star rating in product item
add_action( 'init', 'ec_child_remove_product_item_star_rating', 10 );
function ec_child_remove_product_item_star_rating() {
remove_action( 'woocommerce_after_shop_loop_item_title', 'electro_template_loop_rating', 70 );
}
@akther80
akther80 / scripts.js
Created April 12, 2019 10:50
Tokoo - Hide extra space in Off-canvas-navigation
jQuery(document).ready(function( $ ){
$( '.off-canvas-navigation-wrapper .navbar-toggle-hamburger' ).on( 'click', function() {
$('body').toggleClass( "off-canvas-active" );
} );
});
@akther80
akther80 / functions.php
Created May 14, 2019 07:28
Techmarket - Store Directory
if ( ! function_exists( 'techmarket_store_directory' ) ) {
function techmarket_store_directory() {
ob_start();
?>
<div class="techmarket-store-directory clearfix">
<hr class="no-margin">
<?php the_widget( 'WC_Widget_Product_Categories', array( 'hide_empty' => false ) ); ?>
</div>
<?php
@akther80
akther80 / functions.php
Created May 25, 2019 05:47
Electro v2 - Add wishlist and Compare text below header icon
if ( ! function_exists( 'electro_compare_header_icon' ) ) {
/**
* @since 2.0
*/
function electro_compare_header_icon() {
if( function_exists( 'electro_get_compare_page_url' ) ) :
global $yith_woocompare;
$header_tooltip_placement = apply_filters( 'electro_header_tooltip_placement', 'bottom' );
?><div class="header-icon header-icon-wishlist" <?php if ( $header_tooltip_placement ) : ?>data-toggle="tooltip" data-placement="<?php echo esc_attr( $header_tooltip_placement ); ?>" data-title="<?php echo esc_attr( esc_html__( 'Compare', 'electro' ) ); ?>"<?php endif; ?>>
<a href="<?php echo esc_attr( electro_get_compare_page_url() ); ?>">
@akther80
akther80 / functions.php
Created May 25, 2019 06:57
Electro v2 - Add description below title in Single Product page
add_action( 'init', 'ec_change_description_below_title', 10 );
function ec_change_description_below_title() {
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 6 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
}
@akther80
akther80 / functions.php
Created June 17, 2019 08:39
Electro v2 - Move Short Description below Price
add_action( 'init', 'ec_child_move_description_below_price', 5 );
function ec_child_move_description_below_price() {
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 26 );
}
@akther80
akther80 / style.css
Created June 17, 2019 08:57
Electro v2 - Add different background color for different pages
body.home {
background: #fcfcfc;
}
body.post-type-archive {
background: #f5f5f5;
}
body.tax-product_cat {
background: #e5e5e5;
@akther80
akther80 / functions.php
Created July 1, 2019 07:48
Electro v2 - Add custom code between logo and search field
add_action( 'init', 'ec_child_add_custom_code_after_header_logo' );
function ec_child_add_custom_code_after_header_logo() {
add_action( 'electro_masthead', 'electro_header_custom_code', 15 );
}
if ( ! function_exists( 'electro_header_custom_code' ) ) {
function electro_header_custom_code() {
@akther80
akther80 / functions.php
Created July 2, 2019 05:23
Electro v2 - Disable Wishlist and Compare in header
add_action( 'init', 'ec_child_remove_header_icons' );
function ec_child_remove_header_icons() {
remove_action( 'electro_header_icons', 'electro_compare_header_icon', 70 );
remove_action( 'electro_header_icons', 'electro_wishlist_header_icon', 80 );
}
@akther80
akther80 / functions.php
Created July 4, 2019 13:14
Uneno - Remove product meta from Single Product page
add_action( 'init', 'un_child_remove_single_product_meta', 10 );
function un_child_remove_single_product_meta() {
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
}