Site logo

[Resolved] Primary navigation with logo right align

Home Forums Support [Resolved] Primary navigation with logo right align

Home Forums Support Primary navigation with logo right align

Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • #539952
    Tom
    Lead Developer
    Lead Developer

    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();
    }
    #540340
    Verónica

    Thanks! I think maybe there’s something missing, because the result is the following

    https://imgur.com/FDV0sx4

    Apologizes for bodering you so much! I promise to do a php course in the future!!

    #540531
    Tom
    Lead Developer
    Lead Developer

    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

    #541394
    Verónica

    Thanks Tom! I’ve tried and now the number of items is showed, but not the cart icon
    https://imgur.com/MPR9JNj

    #541533
    Tom
    Lead Developer
    Lead Developer

    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.

    #543386
    Verónica

    Thanks so so much Tom!!! You’re help and support is amazing! Have a nice weekend!

    #543395
    Tom
    Lead Developer
    Lead Developer

    Thank you!! I’m glad you got it sorted! 🙂

Viewing 7 posts - 16 through 22 (of 22 total)
  • You must be logged in to reply to this topic.