Hide title in Woocommerce product category page - wordpress

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/

Related

Woocommerce Product Page Breadcrumb-title edit

i want it to be
I want to replace the top Store page name on the wordpress product page with the product name, can anyone help?
example:
i want it to be
How can I do? There is no such setting in the properties of the theme?
Not knowing what theme you are using or how the Shop title is being generated, try adding this code to your functions.php file
add_filter( 'woocommerce_page_title', 'woo_shop_page_title');
function woo_shop_page_title( $page_title ) {
if( 'Shop' == $page_title) {
return the_title();
}
}
This code replaces the page title Shop with the title of the product (post).

How to add a class to body element if it's a frontpage in WordPress?

last days I have been writing my own WordPress theme, but I run into another problem. These times I have no clue, how to make it possible.
I would like to add a class to every frontpage on my website. So if a single page becomes a frontpage, it will get another class to body tag like "home".
Almost every premium theme gots this funcion, but I just cant find the solution.
Does anybody have any idea?
Thank you! Stepan
You can add the class in body tag using body_class filter as shown below:
function home_body_class($classes) {
if ( is_front_page() ) {
$classes[] = 'home';
}
return $classes;
}
add_filter( 'body_class', 'home_body_class' );
You can manipulate the condition for the static homepage, blog page and so on.

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>';
}

Remove page title from Woocommerce shop in Wordpress

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.

Woocoomerce remove product count from attributes

On a WordPress installation with Woocommerce I have an issue with wrong number of product count on the frontend. That's why I decided to remove it. I have remove it from sidebars and anywhere with snippets but not on product attributes.
Is there any snipped to fix that?
If you want really remove (not just hide) you need to edit your theme function.php file by adding at the end this code:
add_filter( 'woocommerce_layered_nav_count', '__return_false' );
It's work for WOOCommerce v 3.4.3
Here is a quick snippet to remove products count after categories names using WooCommerce. It’s pretty useful in particular when your main shop page list categories instead of listing products. you can put it in 'functions.php' file in your theme.
add_filter( 'woocommerce_subcategory_count_html', 'woo_remove_category_products_count' );
function woo_remove_category_products_count() {
return;
}
Adding
small.count
{
display: none !important;
}
to your style sheet should work. It should hide the product count.
i think i allready have that.
See what functions.php file includes
<?php
define('ETHEME_DOMAIN', 'legenda');
require_once( get_template_directory() . '/framework/init.php' );
add_filter( 'woocommerce_subcategory_count_html', 'jk_hide_category_count' );
function jk_hide_category_count() {
// No count
}
add_filter( 'woocommerce_subcategory_count_html', 'woo_remove_category_products_count' );
function woo_remove_category_products_count() {
return;
}
you can swee live that is not worked at http://www.karadimos.gr/product-category/xalia/
BTW thanx for your reply!!!

Resources