Adham19 Posted January 16, 2018 Share Posted January 16, 2018 Hello Community, i have a problem on my wordpress site. I basically don't want to have that the the "header-cart-amount" class shows how many items i have. Here is an example: Here is the php code: <div class="site-header-top"> <div class="site-container"> <nav id="site-navigation" class="main-navigation avant-nav-style-plain" role="navigation"> <span class="header-menu-button"><i class="fa fa-bars"></i><span><?php echo esc_attr( get_theme_mod( 'avant-header-menu-text', __( 'menu', 'avant' ) ) ); ?></span></span> <div id="main-menu" class="main-menu-container"> <span class="main-menu-close"><i class="fa fa-angle-right"></i><i class="fa fa-angle-left"></i></span> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu' ) ); ?> </div> <div class="header-cart"> <a class="header-cart-contents" href="<?php echo esc_url( $woocommerce->cart->get_cart_url() ); ?>" title="<?php esc_attr_e( 'Indkøbskurv', 'avant' ); ?>"> </a> </div> <div class="site-header-search"> <?php if ( !get_theme_mod( 'avant-header-search' ) ) : ?> <div class="menu-search"> <i class="fa fa-search search-btn"></i> </div> <?php endif; ?> <?php if ( avant_is_woocommerce_activated() ) : ?> <?php if ( !get_theme_mod( 'avant-header-remove-cart' ) ) : ?> <?php endif; ?> <?php endif; ?> </div> </nav><!-- #site-navigation --> </div> <div class="clearboth"></div> </div> I want to have a text instead. It should look like this: I have already deleted the function, but it still there. Can someone help me? King Regards, Adham Quote Link to comment https://forums.phpfreaks.com/topic/306213-wordpress-php-help/ Share on other sites More sharing options...
phpmillion Posted January 16, 2018 Share Posted January 16, 2018 Is this code before or after your modification? You may want to to post both (before/after), so we can see what you did so and why it doesn't work. Quote Link to comment https://forums.phpfreaks.com/topic/306213-wordpress-php-help/#findComment-1555391 Share on other sites More sharing options...
Adham19 Posted January 16, 2018 Author Share Posted January 16, 2018 This code is modifcatet. Here is the before: <div class="site-header-top"> <div class="site-container"> <div class="site-header-top-left"> <nav id="site-navigation" class="main-navigation avant-nav-style-plain" role="navigation"> <span class="header-menu-button"><i class="fa fa-bars"></i><span><?php echo esc_attr( get_theme_mod( 'avant-header-menu-text', __( 'menu', 'avant' ) ) ); ?></span></span> <div id="main-menu" class="main-menu-container"> <span class="main-menu-close"><i class="fa fa-angle-right"></i><i class="fa fa-angle-left"></i></span> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu' ) ); ?> </div> </nav><!-- #site-navigation --> </div> <div class="site-header-top-right"> <?php if ( avant_is_woocommerce_activated() ) : ?> <?php if ( !get_theme_mod( 'avant-header-remove-cart' ) ) : ?> <div class="header-cart"> <a class="header-cart-contents" href="<?php echo esc_url( $woocommerce->cart->get_cart_url() ); ?>" title="<?php esc_attr_e( 'View your shopping cart', 'avant' ); ?>"> <span class="header-cart-amount"> <?php echo sprintf( _n( '%d item', '%d items', $woocommerce->cart->cart_contents_count, 'avant' ), $woocommerce->cart->cart_contents_count ); ?><span> - <?php echo $woocommerce->cart->get_cart_total(); ?></span> </span> <span class="header-cart-checkout <?php echo ( $woocommerce->cart->cart_contents_count > 0 ) ? sanitize_html_class( 'cart-has-items' ) : ''; ?>"> <i class="fa fa-shopping-cart"></i> </span> </a> </div> <?php endif; ?> <?php endif; ?> </div> <div class="clearboth"></div> </div> </div> Quote Link to comment https://forums.phpfreaks.com/topic/306213-wordpress-php-help/#findComment-1555402 Share on other sites More sharing options...
phpmillion Posted January 16, 2018 Share Posted January 16, 2018 Yes, it looks "items" part is removed properly. Maybe you have some cache plugin on your WP site? Also, you may want to do forced page reload in your browser. If that doesn't help, let us know... Quote Link to comment https://forums.phpfreaks.com/topic/306213-wordpress-php-help/#findComment-1555408 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.