Title: Responsive Design and Plugin Hide
Last modified: August 21, 2016

---

# Responsive Design and Plugin Hide

 *  [Paul](https://wordpress.org/support/users/armstrong698/)
 * (@armstrong698)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/responsive-design-and-plugin-hide/)
 * Firstly, your plugin looks fantastic on our website. Unfortunately though, the
   tab takes up most of the screen while viewing on a mobile phone. It would be 
   fantastic if you could make the tab a little more responsive.
 * But the main issue is that I viewed your other post about making the tab only
   show when items in the basket = >0. You provided this code to wrap the entire
   template in?
 *     ```
       if ( sizeof( $woocommerce->cart->cart_contents ) == 0 ) {
       // The cart is empty
       }
       ```
   
 * If you could be a bit more specific to us less technically gifted that would 
   be fantastic.
 * Here’s my code:
 *     ```
       // Display the cart tab and widget
       			function woocommerce_cart_tab() {
       				global $woocommerce;
       				$skin = get_option( 'wc_ct_skin' );
       				$position = get_option( 'wc_ct_horizontal_position' );
       				$widget = get_option( 'wc_ct_cart_widget' );
       				if ( ! is_cart() && ! is_checkout() ) {
       					if ( $widget == 'yes' ) {
       						echo '<div class="' . $position . ' cart-tab ' . $skin . '">';
       					} else {
       						echo '<div class="' . $position . ' cart-tab no-animation ' . $skin . '">';
       					}
       						wcct_cart_button();
       						// Display the widget if specified
       						if ( $widget == 'yes' ) {
       							// Check for WooCommerce 2.0 and display the cart widget
       							if ( version_compare( WOOCOMMERCE_VERSION, "2.0.0" ) >= 0 ) {
       								the_widget( 'WC_Widget_Cart', 'title=' );
       							} else {
       								the_widget( 'WooCommerce_Widget_Cart', 'title=' );
       							}
       						}
       					echo '</div>';
       				}
       			}
       		}
   
       		// Displays the cart total and number of items as a link
       		function wcct_cart_button() {
       			global $woocommerce;
       			?>
       			<a href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e( 'View your shopping cart', 'woocommerce-cart-tab' ); ?>" class="cart-parent">
       				<?php
       					echo $woocommerce->cart->get_cart_total();
       					echo '<span class="contents">' . sprintf( _n( '%d item', '%d items', $woocommerce->cart->get_cart_contents_count(), 'woocommerce-cart-tab' ), $woocommerce->cart->get_cart_contents_count() ) . '</span>';
       				?>
       			</a>
       			<?php
       		}
   
       		$WC_ct = new WC_ct();
       	}
       }
       ```
   
 * Where exactly to I place the code?
 * Your help would be hugely appreciated =)
 * [http://wordpress.org/extend/plugins/woocommerce-cart-tab/](http://wordpress.org/extend/plugins/woocommerce-cart-tab/)

The topic ‘Responsive Design and Plugin Hide’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/woocommerce-cart-tab_d7d3d0.svg)
 * [WooCommerce Cart Tab](https://wordpress.org/plugins/woocommerce-cart-tab/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-cart-tab/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-cart-tab/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-cart-tab/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-cart-tab/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-cart-tab/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Paul](https://wordpress.org/support/users/armstrong698/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/responsive-design-and-plugin-hide/)
 * Status: not resolved