Remove page title from Woocommerce shop in Wordpress - css

i'm trying to remove the page title from my woocommerce shop page. If i use this css the page title is removed from all pages, this is not what i want.
.page-heading h1 {display: none;}
So i started looking for a page-id, but it seems the shop is a post, so i used postid of my page
.postid-15169 .page-heading h1 {display: none;}
but this doesn't work at all
i also tried to put this is my functions.php
add_filter( 'woocommerce_page_title', false);
But this doesn't do anything either. I guess it's not the shop title i'm needing to remove, just the page title.
Any idea what i can do to remove the title for this page only ?
you can find the page here: https://goo.gl/5LNwRR

I added a ccs code:
.page-title-shop h1 {
display: none;
}
It worked for Woocommerce 3.2.x

Instead of using css, you can use woocommerce filter to get the job done.
function wc_hide_page_title()
{
if( !is_shop() ) // is_shop is the conditional tag
return true;
}
add_filter( 'woocommerce_show_page_title', 'wc_hide_page_title' );
You can remove titles from all woocommerce pages. Here is a blog post about this.

Related

CSS ID WooCommerce Shop Page

Is there a CSS ID for the WooCommerce shop page like there is for single-product etc, so that I can easily target CSS for that page only?
WooCommerce does not add a body class specifically for the main shop page.
post-type-archive-product is probably enough for most cases.
But if you want to specifically style the main shop page instead of all product archives then you can use a filter:
add_filter('body_class', 'add_my_woocommerce_shop_body_class');
function add_my_woocommerce_shop_body_class($classes)
{
if (is_shop()) {
$classes[] = 'my-woocommerce-shop-class';
}
return $classes;
}
You can check for classes in body tag of your shop page. If your theme adds any specific class for shop then you'll find it there else post-type-archive-product class may help.

Hide title in Woocommerce product category page

Maybe this is too easy for you but to me...I can't do it! Guys, I need to hide the title in 2 of my product categories pages in Woocommerce. product-category/cat1 (category id 145) & product-category/cat2 (category id 146)
I tried to achieve that using CSS:
.catid-145 .entry-title {
visibility: hidden;
}
or
.category-145 .entry-title {
visibility: hidden;
}
I know this title is controlled by:
<h1 class="entry-title">Title here</h1>
I need to remove the title text and preserve the space, that's why I'm using "hidden".
Any idea will be highly appreciated. Thank you.
Please try this :
.catid-145 h1.entry-title {
display: none;
}
Adding the following code will remove the page title from Product Category Page :
if(is_product_category())
{
add_filter( 'woocommerce_show_page_title', '__return_false' );
}
Please add the code in functions.php directly to check. Hope this will help you.
Searching how to hide specific category from WooCommerce side bar, this code will help you.
Go to Products> Categories> Click edit on the category you want to remove.
Once category page is open, you can find the category id in the url, copy that id.
WooCommerce hide category from side
Then open the functions.php file under appearance> theme editor.
Just paste the below code at the end and please replace categories id (in italic) with your category id.
add_filter( ‘woocommerce_product_categories_widget_args’, ‘woo_product_cat_widget_args’ );
function woo_product_cat_widget_args( $cat_args ) {
$cat_args[‘exclude’] = array(‘1725’,’1721′,’1719′,’1722′,’1723′,’1724′,’1725′,’1726′);
return $cat_args;
}
https://phpfresh.com/hide-categories-from-woocommerce-sidebar/

How to remove fields from woocommerce product admin form?

I would like to remove Virtual, Downloadable, Regular Price from Woocommerce product admin form. Any ideas on how to get this to work?
It looks like there is no way to programmatically remove the fields from the woocommerce product admin pages. However you can remove them using CSS.
To do this start by editing the wp admin css, like this (add to functions.php):
add_action('admin_head', 'my_custom_admin_styles');
function my_custom_admin_styles() {
echo '<style>
</style>';
}
Then all you need to get the selectors for the fields you want to remove, the example below removes the 'regular price' field:
add_action('admin_head', 'my_custom_admin_styles');
function my_custom_admin_styles() {
// just add the css selectors below to hide each field as required
echo '<style>
.form-field._regular_price_field { display: none; }
</style>';
}

How to remove cart icon from primary menu navigation bar in woo commerce wordpress site

I wanted to remove the cart icon from my nav bar using woocommerce. There did not seem to be a setting in the admin to do that.
I used this code
function remove_nav_cart_link () {
remove_action( 'woo_nav_inside', 'woo_add_nav_cart_link', 20);
}
add_action( 'after_setup_theme', 'remove_nav_cart_link' );
The setting is under WooThemes -> WooCommerce -> Header Cart Link
for me the following solution worked but nothing else
Just added the following code in Theme's custom css
Appearance>Themes>Your theme>Custom CSS
#top .wc-nav li.cart {
display: none !important;}
#top .wc-nav li.checkout{
display: none !important;}
I don't use WooTheme, just the WooCommerce plugin and the header cart still appeared in my premium theme, so instead of disabling it by a function I just used the following CSS code in my child theme..
#Top_bar a#header_cart { display:none }
Go to \wamp64\www\....\wp-content\themes\yourtheme\includes\header-top-bar-right
Find line WooCommerce Cart
Comment the line out:
echo '<a id="header_cart" href="'. $woocommerce->cart->get_cart_url() .'"><i class="'. $show_cart .'"></i><span>'. $woocommerce->cart->cart_contents_count .'</span></a>';
Go to wp-content/themes/yourtheme/inc/woocommerce/yourthemename-woocommerce-template-hook
search for
add_action( 'storefront_header', 'storefront_product_search', 40 );
add_action( 'storefront_header', 'storefront_header_cart', 60 );
comment these 2 lines..!!

How to hide classes on some pages in WordPress?

How do I hide some CSS classes on some pages in WordPress? Like if I want to hide featured image in blog posts we use:
.single .post-thumbnail {
display:none;
}
I want the class (like .single) for homepage, search page, archives, etc.
You would need to target the page class. If you look at the source code on whatever page you are on, you'll notice the body class include a unique identifier for your page. You can then target that way. See the Codex for a full run-down of page classes.
Home is home, search is search, archives is archive. The homepage won't be single because that's reserved for posts.
You could set custom ones with a filter.
add_filter( 'body_class', 'new_body_class' );
function new_body_class( $classes ) {
if ( is_front_page())
$classes[] = 'custom-class';
return $classes;

Resources