Skip to content

Instantly share code, notes, and snippets.

@akther80
Created December 6, 2018 05:51
Show Gist options
  • Save akther80/657a923ba9a90ec0c3eb0fc57fd737fd to your computer and use it in GitHub Desktop.
Save akther80/657a923ba9a90ec0c3eb0fc57fd737fd to your computer and use it in GitHub Desktop.
Electro v2 - Add wishlist to mobile header
add_filter( 'electro_handheld_header_links', 'ec_child_add_wishlist', 10 );
function ec_child_add_wishlist( $links ) {
$links['wishlist'] = array(
'priority' => 40,
'callback' => 'ec_child_wishlist_header_link'
);
return $links;
}
function ec_child_wishlist_header_link() {
if ( function_exists( 'yith_wcwl_count_products' ) && function_exists( 'electro_get_wishlist_url' ) ) : ?>
<a href="<?php echo esc_attr( electro_get_wishlist_url() ); ?>" class="nav-link">
<i class="<?php echo esc_attr( apply_filters( 'electro_wishlist_icon', 'ec ec-favorites' ) ); ?>"></i>
<?php if ( apply_filters( 'electro_show_wishlist_count', false ) ) : ?>
<span class="navbar-wishlist-count count" class="value"><?php echo yith_wcwl_count_products(); ?></span>
<?php endif; ?>
</a>
<?php endif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment