Skip to content

Instantly share code, notes, and snippets.

@akther80
akther80 / functions.php
Created January 10, 2019 06:10
Electro v2 - Move category description below the content
add_action( 'init', 'ec_child_move_archive_desc_below_content' );
function ec_child_move_archive_desc_below_content() {
remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
remove_action( 'woocommerce_archive_description', 'woocommerce_product_archive_description', 10 );
add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description', 91 );
add_action( 'woocommerce_after_shop_loop', 'woocommerce_product_archive_description', 91 );
}
@akther80
akther80 / functions.php
Created January 11, 2019 13:11
Electro v2 - Display single product title above image wrapper
add_action( 'init', 'ec_child_move_single_product_title_above_image_wrapper' );
function ec_child_move_single_product_title_above_image_wrapper() {
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
add_action( 'woocommerce_before_single_product_summary', 'woocommerce_template_single_title', 1 );
}
@akther80
akther80 / functions.php
Created January 16, 2019 12:33
Electro v2 - Tag list above comment form
add_filter( 'electro_is_single_post_tags_list', '__return_false', 20 );
add_action( 'electro_single_post_after', 'ec_child_tag_list_above_comment_form', 20 );
if ( ! function_exists( 'ec_child_tag_list_above_comment_form' ) ) {
function ec_child_tag_list_above_comment_form() {
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', __( ', ', 'electro' ) );
if ( $tags_list ) : ?>
<div class="post-tags">
<span class="tags-links">
@akther80
akther80 / functions.php
Last active January 30, 2022 16:24
Electro v2 - Add cart and user account label
if ( ! function_exists( 'electro_header_mini_cart_icon' ) ) {
/**
* @since 2.0
*/
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' );
@akther80
akther80 / custom.html
Created January 18, 2019 09:14
Vodi sidebar HTML
Categories:
<div class="widget_categories">
<ul>
<li class="cat-item cat-item-2"><a href="http://localhost/~akther/vodi/category/alignment/" title="Posts in this category test image and text alignment.">Alignment</a>
</li>
<li class="cat-item cat-item-3"><a href="http://localhost/~akther/vodi/category/post-format-aside/" title="Posts in this category test the aside post format.">Aside</a>
</li>
<li class="cat-item cat-item-4"><a href="http://localhost/~akther/vodi/category/post-format-audio/" title="Posts in this category test the audio post format.">Audio</a>
@akther80
akther80 / functions.php
Created January 22, 2019 12:22
Electro v2 - Change handheld screen size
if ( ! function_exists( 'electro_mobile_header_v1' ) ) {
/**
* Displays Mobile Header v1
*/
function electro_mobile_header_v1() {
if( has_electro_mobile_header() ) : ?>
<div class="container hidden-lg-up">
<div class="mobile-header-v1 handheld-stick-this">
<?php
/**
@akther80
akther80 / functions.php
Last active February 1, 2019 14:59
Uneno - Header User Account in Home v2
add_action( 'init', 'un_child_add_header_user_account_in_home_v2' );
function un_child_add_header_user_account_in_home_v2() {
add_action( 'uneno_header_v2_icons', 'uneno_header_user_account', 30 );
}
@akther80
akther80 / functions.php
Created February 4, 2019 09:08
Uneno - Edit text on Order Received page of Checkout
add_filter( 'uneno_order_confirmation_note_args', 'uneno_child_order_confirmation_note_custom_args');
if ( ! function_exists( 'uneno_child_order_confirmation_note_custom_args' ) ) {
function uneno_child_order_confirmation_note_custom_args($args) {
$args['title'] = esc_html__( 'Payment Successful', 'uneno' );
$args['sub-title'] = esc_html__( 'Thank you! Your payment was successful! We will deliver your order quickly.Now it’s time to discover our other collection.', 'uneno' );
return $args;
}
}
@akther80
akther80 / functions.php
Last active February 5, 2019 15:28
Electro - Departments menu show dropdown by default in default template
if ( ! function_exists( 'el_child_default_template_departments_menu_show_dropdown' ) ) {
function el_child_default_template_departments_menu_show_dropdown( $enable_dropdown ) {
return is_front_page() ? false : $enable_dropdown;
}
}
add_filter( 'electro_departments_menu_v2_enable_dropdown', 'el_child_default_template_departments_menu_show_dropdown', 90 );
@akther80
akther80 / functions.php
Created February 7, 2019 06:19
Electro v2 - Add confirm password field in Registration Form
// ----- validate password match on the registration page
function registration_errors_validation($reg_errors, $sanitized_user_login, $user_email) {
global $woocommerce;
extract( $_POST );
if ( strcmp( $password, $password2 ) !== 0 ) {
return new WP_Error( 'registration-error', __( 'Passwords do not match.', 'electro' ) );
}
return $reg_errors;
}
add_filter('woocommerce_registration_errors', 'registration_errors_validation', 10,3);