Archived topic
Primary navigation with logo right align
21 replies · Started by Verónica on March 20, 2018
Sorry to hear that! Never easy.
Replace this function:
function tu_custom_wc_cart_link() {
ob_start();
?>
<a>cart->get_cart_url() ); ?>" class="cart-contents" title="<?php esc_attr_e( 'View your shopping cart','generate-woocommerce' ); ?>">
<?php _e( 'Cart','generate-woocommerce' );?> - <?php echo sprintf ( _n( '<span class="number-of-items">%d</span> item', '<span class="number-of-items">%d</span> items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?>
</a>
<?php
return ob_get_clean();
}
With this:
function tu_custom_wc_cart_link() {
ob_start();
?>
<a href="<?php echo esc_url( WC()->cart->get_cart_url() ); ?>" class="cart-contents" title="<?php esc_attr_e( 'View your shopping cart','generate-woocommerce' ); ?>">
<?php echo sprintf ( _n( '<span class="number-of-items">%d</span>', '<span class="number-of-items">%d</span> items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?>
</a>
<?php
return ob_get_clean();
}
Thanks! I think maybe there's something missing, because the result is the following
Apologizes for bodering you so much! I promise to do a php course in the future!!
Sorry about that! There was an issue with the code.
I just made an edit above - can you try again?: https://generatepress.com/forums/topic/primary-navigation-with-logo-right-align/page/2/#post-539952
Thanks Tom! I've tried and now the number of items is showed, but not the cart icon
https://imgur.com/MPR9JNj
I'm seeing it - perhaps try clearing your browser cache.
However, you seem to have some CSS that's causing the page to be super wide, which is causing horizontal scroll.
Thanks so so much Tom!!! You're help and support is amazing! Have a nice weekend!
Thank you!! I'm glad you got it sorted! :)