Skip to content

Instantly share code, notes, and snippets.

Last active July 17, 2021 04:11
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Add WooCommerce mini cart to primary nav Genesis
* Add WooCommerce cart to primary navigation Genesis
* @author Frank Schrijvers
* @link
if ( class_exists( 'WooCommerce' ) ) {
add_action( 'genesis_header_right', 'wpstudio_add_cart' );
function wpstudio_add_cart() {
echo '<div class="mini-cart">';
echo '<a href="' . WC()->cart->get_cart_url() .'"title="View your shopping cart">'. WC()->cart->get_cart_total(). '</a>';
echo '<span class="cart-count">' . WC()->cart->cart_contents_count . '</span></div>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment