Home › Forums › Themes Support › Claue › Modify Category Header
- This topic has 25 replies, 2 voices, and was last updated 5 years, 2 months ago by Harry.
-
AuthorPosts
-
-
September 19, 2019 at 9:36 pm #33660
Hi Harry,
another thing.
I want basically that on the shop category-, tag-, as well on the attribute-archives that the grey bar should go away. Can we modify something in the archive-product.php (and some small CSS) to only have the title displayed in black?
When you access the shop page on mobile – you see how I actually want it. Now I have this background just not shown (hidden via CSS) but actually I just want to get rid of the code so that the background picture on the categories is not loading in the back anymore.
This standard grey bar (when no background picture is set) can easily be overwritten with CSS or would it be better to change the code there as well?
Thanks.
Attachments:
You must be logged in to view attached files. -
September 19, 2019 at 9:39 pm #33663
You know the main thing is, I actually want to keep the category background picture in case I will insert categories via shortcode somewhere in the future, but the category pictures should not load on the product-category page. So basically the code have to be changed to “not load product-category picture in header”.
-
September 20, 2019 at 7:43 am #33676
Hi Florian,
Please add below code to Claue > Theme Option > General Layout > Custom CSS
.archive.post-type-archive .page-head::before, .archive tax-product_cat .page-head::before { background: none; padding: 10px 0; } .archive.post-type-archive .page-head h1, .archive tax-product_cat .page-head h1 { color: #222; }
Btw, your support expired. Could you please renew your support at https://themeforest.net/item/claue-clean-minimal-woocommerce-theme/18929281 that will help us continue develop new features and improve our theme.
Thank and regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
September 20, 2019 at 2:31 pm #33677
-
September 20, 2019 at 4:36 pm #33679
Hi Florian.
You mean you want remove background image on shop page but still keep in category page or complete remove all?
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
September 20, 2019 at 4:44 pm #33680
I doesn’t want the background image to be loaded in the header of the shop, product-category, product-tag, product-attribute pages BUT want to keep the possibility to insert product categories via shortcode (because when I insert them via shortcode it will display a background picture and if there is none because previoulsy I deleted all then I can not do this). Hope this was not to complicated explained, if so please just look at the first part. “I doesn’t want the background image to be loaded in the header of the shop, product-category, product-tag, product-attribute pages”. Thanks!
-
September 20, 2019 at 7:09 pm #33685
Hi Florian,
Please add below code to claue-child > functions.php
/* move category description below products */ add_action( 'wp_head', 'remove_my_action' ); function remove_my_action(){ remove_action( 'woocommerce_before_main_content', 'jas_claue_wc_page_head', 15 ); } function jas_claue_child_wc_page_head() { if ( ! cs_get_option( 'wc-enable-page-title' ) || ( class_exists( 'WCV_Vendors' ) && WCV_Vendors::is_vendor_page() ) ) return; $title = cs_get_option( 'wc-page-title' ); if ( is_search() ) { $output .= '<h1 class="mb__5 cw">' . sprintf(__( 'Search Results for: %s', 'claue' ), '<span>' . get_search_query() . '</span>' ) . '</h1>'; } elseif ( is_product_category() ) { // Remove old position of category description remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); $output = '<div class="page-head pr tc"><div class="jas-container pr">'; $output .= '<h1 class="cw">' . single_cat_title( '', false ) . '</h1>'; $output .= do_shortcode( category_description() ); $output .= '</div></div>'; } else { $output .= ''; } ob_start(); $output .= ob_get_clean(); echo wp_kses_post( $output ); } add_action( 'woocommerce_before_main_content', 'jas_claue_child_wc_page_head', 15 );
Kind regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
September 21, 2019 at 2:59 am #33695
Hi Harry,
I have the code already in my functions.php (https://www.fashionchingu.com/adeelmustafa/wp-admin/options-general.php?page=my-custom-functions) and it does what it should “Change Category Text Position”, but this is not the thing I want in this thread. I am not sure what is unclear, please tell me.
Best,
Florian
-
September 21, 2019 at 10:48 am #33707
Hi,
You code different with my code. Please change your code on line 65 – 95 to
//Change position of category text function remove_shop_heading() { remove_action( 'woocommerce_before_main_content', 'jas_claue_wc_page_head', 15 ); } add_action('wp_head', 'remove_shop_heading'); function jas_claue_child_wc_page_head() { if ( ! cs_get_option( 'wc-enable-page-title' ) || ( class_exists( 'WCV_Vendors' ) && WCV_Vendors::is_vendor_page() ) ) return; $title = cs_get_option( 'wc-page-title' ); if ( is_search() ) { $output .= '<h1 class="mb__5 cw">' . sprintf(__( 'Search Results for: %s', 'claue' ), '<span>' . get_search_query() . '</span>' ) . '</h1>'; } elseif ( is_product_category() ) { // Remove old position of category description remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); $output = '<div class="page-head pr tc"><div class="jas-container pr">'; $output .= '<h1 class="cw">' . single_cat_title( '', false ) . '</h1>'; $output .= do_shortcode( category_description() ); $output .= '</div></div>'; } else { $output .= ''; } ob_start(); $output .= ob_get_clean(); echo wp_kses_post( $output ); } add_action( 'woocommerce_before_main_content', 'jas_claue_child_wc_page_head', 15 );
Kind regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
September 21, 2019 at 3:12 pm #33714
Hi Harry,
applied the code – thank you for this.
It’s not so perfect yet.
- The background picture is just gone on shop, and not on product-category,product-tag & product attribute. Despite that, on the shop picture there is also no title but the title (H1) is pretty essential.
- On product-categories the background picture is still loaded.
- When I have text now on the product category it looks like this https://www.fashionchingu.com/adeelmustafa/kpop-fashion/bts-clothes/
I hope you have one more idea. Thank you so much.
-
September 21, 2019 at 3:14 pm #33716
Normally category text is below the products. We did this previously together in this thread: http://support.janstudio.net/forums/topic/product-category-text-should-be-displayed-above-products/
-
September 21, 2019 at 7:08 pm #33723
Hi,
I think you want keep on product category. Please change code to
//Change position of category text function remove_shop_heading() { remove_action( 'woocommerce_before_main_content', 'jas_claue_wc_page_head', 15 ); } add_action('wp_head', 'remove_shop_heading'); function jas_claue_child_wc_page_head() { if ( ! cs_get_option( 'wc-enable-page-title' ) || ( class_exists( 'WCV_Vendors' ) && WCV_Vendors::is_vendor_page() ) ) return; $title = cs_get_option( 'wc-page-title' ); if ( is_search() ) { $output .= '<h1 class="mb__5 cw">' . sprintf(__( 'Search Results for: %s', 'claue' ), '<span>' . get_search_query() . '</span>' ) . '</h1>'; } else { // Remove old position of category description remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); $output .= '<h1 class="cw">' . single_cat_title( '', false ) . '</h1>'; add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description', 10 ); } ob_start(); $output .= ob_get_clean(); echo wp_kses_post( $output ); } add_action( 'woocommerce_before_main_content', 'jas_claue_child_wc_page_head', 15 );
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
September 22, 2019 at 6:19 pm #33757
Great, that did it. Now only the Heading is completly white. Does it have a reason why you put class=”Cw” into the H1?
Thank you so much!
-
September 22, 2019 at 7:17 pm #33759
You can remove this class because we use class for our theme style with dark background.
Kind regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
September 24, 2019 at 3:57 pm #33813
Okay great I replaced it, everything fine.
Sorry for bothering one more time, but is it possible to trigger this function only on mobile devices?
Thank you & greetings,
Florian -
September 24, 2019 at 5:12 pm #33814
Hi Florian,
Please change code to
if ( wp_is_mobile() ) { //Change position of category text function remove_shop_heading() { remove_action( 'woocommerce_before_main_content', 'jas_claue_wc_page_head', 15 ); add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 ); } add_action('wp_head', 'remove_shop_heading'); function jas_claue_child_wc_page_head() { if ( ! cs_get_option( 'wc-enable-page-title' ) || ( class_exists( 'WCV_Vendors' ) && WCV_Vendors::is_vendor_page() ) ) return; $title = cs_get_option( 'wc-page-title' ); if ( is_search() ) { $output .= '<h1 class="mb__5 cw">' . sprintf(__( 'Search Results for: %s', 'claue' ), '<span>' . get_search_query() . '</span>' ) . '</h1>'; } else { // Remove old position of category description remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); $output .= '<h1 class="cw">' . single_cat_title( '', false ) . '</h1>'; add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description', 10 ); } ob_start(); $output .= ob_get_clean(); echo wp_kses_post( $output ); } add_action( 'woocommerce_before_main_content', 'jas_claue_child_wc_page_head', 15 ); }
Kind regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
September 25, 2019 at 3:55 pm #33819
Hi Harry,
Thank you!
Now the Category Text is on mobile above the products it has to be below the products 🙂
Okay and the last thing is, since on attributes & tags you can not set a background picture, can we apply the code as well on Desktop for Product-Attributes & -Tags?
You’re the man. Thank you!
-
September 25, 2019 at 4:33 pm #33821
Hi Florian,
1. I check on my local the text below products https://prnt.sc/pap583
2. You want remove background with tag and attribute on desktop?
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
September 26, 2019 at 8:50 pm #33829
Hi Harry,
1. This is the code I applied now and on my end somehow category text is not below:
//”ON MOBILE” Change position of category text & Remove Grey Bar & Background Picture Of P-Category, P-Attributes, P-Tags
if ( wp_is_mobile() ) {
function remove_shop_heading() {
remove_action( ‘woocommerce_before_main_content’, ‘jas_claue_wc_page_head’, 15 );
add_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_rating’, 5 );
}
add_action(‘wp_head’, ‘remove_shop_heading’);function jas_claue_child_wc_page_head() {
if ( ! cs_get_option( ‘wc-enable-page-title’ ) || ( class_exists( ‘WCV_Vendors’ ) && WCV_Vendors::is_vendor_page() ) ) return;
$title = cs_get_option( ‘wc-page-title’ );
if ( is_search() ) {
$output .= ‘
<h1 class=”mb__5 cw”>’ . sprintf(__( ‘Search Results for: %s’, ‘claue’ ), ” . get_search_query() . ” ) . ‘</h1>
‘;
} else {
// Remove old position of category description
remove_action( ‘woocommerce_archive_description’, ‘woocommerce_taxonomy_archive_description’, 10 );
$output .= ‘
<h1 class=”cw”>’ . single_cat_title( ”, false ) . ‘</h1>
‘;
add_action( ‘woocommerce_after_shop_loop’, ‘woocommerce_taxonomy_archive_description’, 10 );
}
ob_start();
$output .= ob_get_clean();
echo wp_kses_post( $output );
}
add_action( ‘woocommerce_before_main_content’, ‘jas_claue_child_wc_page_head’, 15 );
}2. Yes totally true 🙂
-
September 26, 2019 at 11:20 pm #33836
Hi,
Please change code to
if ( wp_is_mobile() ) { //Change position of category text function remove_shop_heading() { remove_action( 'woocommerce_before_main_content', 'jas_claue_wc_page_head', 15 ); } add_action('wp_head', 'remove_shop_heading'); function jas_claue_child_wc_page_head() { if ( ! cs_get_option( 'wc-enable-page-title' ) || ( class_exists( 'WCV_Vendors' ) && WCV_Vendors::is_vendor_page() ) ) return; $title = cs_get_option( 'wc-page-title' ); if ( is_search() ) { $output .= '<h1 class="mb__5 cw">' . sprintf(__( 'Search Results for: %s', 'claue' ), '<span>' . get_search_query() . '</span>' ) . '</h1>'; } else { // Remove old position of category description remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); $output .= '<h1 class="cw">' . single_cat_title( '', false ) . '</h1>'; add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description', 10 ); } ob_start(); $output .= ob_get_clean(); echo wp_kses_post( $output ); } add_action( 'woocommerce_before_main_content', 'jas_claue_child_wc_page_head', 15 ); } else { //Change position of category text function remove_shop_heading() { remove_action( 'woocommerce_before_main_content', 'jas_claue_wc_page_head', 15 ); } add_action('wp_head', 'remove_shop_heading'); function jas_claue_child_wc_page_head() { if ( ! cs_get_option( 'wc-enable-page-title' ) || ( class_exists( 'WCV_Vendors' ) && WCV_Vendors::is_vendor_page() ) ) return; $title = cs_get_option( 'wc-page-title' ); if ( is_search() ) { $output .= '<h1 class="mb__5 tc fs__24">' . sprintf(__( 'Search Results for: %s', 'claue' ), '<span>' . get_search_query() . '</span>' ) . '</h1>'; } elseif ( is_shop() ) { $output = '<div class="page-head pr tc"><div class="jas-container pr">'; $output .= '<h1 class="mb__5 cw">' . esc_html( cs_get_option( 'wc-page-title' ) ) . '</h1>'; $output .= '<p class="mg__0">' . do_shortcode( cs_get_option( 'wc-page-desc' ) ) . '</p>'; $output .= '</div></div>'; } elseif ( is_product_category() ) { $output = '<div class="page-head pr tc"><div class="jas-container pr">'; $output .= '<h1 class="mb__5 cw">' . esc_html( cs_get_option( 'wc-page-title' ) ) . '</h1>'; remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description', 10 ); $output .= '</div></div>'; } else { // Remove old position of category description remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); $output .= '<h1 class="tc fs__24">' . single_cat_title( '', false ) . '</h1>'; //$output .= do_shortcode( category_description() ); add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description', 10 ); } ob_start(); $output .= ob_get_clean(); echo wp_kses_post( $output ); } add_action( 'woocommerce_before_main_content', 'jas_claue_child_wc_page_head', 15 ); }
Kind regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
September 27, 2019 at 9:12 pm #33845
Hi Harry,
Thank you very much.
I don’t know why but it creates a fatal error.
Best,
Flo -
September 27, 2019 at 10:23 pm #33849
I used the code on my local it still work well, your function file add more code, please try backup current functions.php and remove other code and only this code and check again.
Kind regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
September 28, 2019 at 5:19 pm #33854
I deleted all files from my functions.php in child theme as well as from my plugin My Custom Functions.
If it works on your site could you please send me code from there, maybe an error or something got pasted in your previous message.
Thank you!
-
September 28, 2019 at 6:23 pm #33855
Hi,
my code in my functions.php
if ( wp_is_mobile() ) { //Change position of category text function remove_shop_heading() { remove_action( 'woocommerce_before_main_content', 'jas_claue_wc_page_head', 15 ); } add_action('wp_head', 'remove_shop_heading'); function jas_claue_child_wc_page_head() { if ( ! cs_get_option( 'wc-enable-page-title' ) || ( class_exists( 'WCV_Vendors' ) && WCV_Vendors::is_vendor_page() ) ) return; $title = cs_get_option( 'wc-page-title' ); if ( is_search() ) { $output .= '<h1 class="mb__5 cw">' . sprintf(__( 'Search Results for: %s', 'claue' ), '<span>' . get_search_query() . '</span>' ) . '</h1>'; } else { // Remove old position of category description remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); $output .= '<h1 class="cw">' . single_cat_title( '', false ) . '</h1>'; add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description', 10 ); } ob_start(); $output .= ob_get_clean(); echo wp_kses_post( $output ); } add_action( 'woocommerce_before_main_content', 'jas_claue_child_wc_page_head', 15 ); } else { //Change position of category text function remove_shop_heading() { remove_action( 'woocommerce_before_main_content', 'jas_claue_wc_page_head', 15 ); } add_action('wp_head', 'remove_shop_heading'); function jas_claue_child_wc_page_head() { if ( ! cs_get_option( 'wc-enable-page-title' ) || ( class_exists( 'WCV_Vendors' ) && WCV_Vendors::is_vendor_page() ) ) return; $title = cs_get_option( 'wc-page-title' ); if ( is_search() ) { $output .= '<h1 class="mb__5 tc fs__24">' . sprintf(__( 'Search Results for: %s', 'claue' ), '<span>' . get_search_query() . '</span>' ) . '</h1>'; } elseif ( is_shop() ) { $output = '<div class="page-head pr tc"><div class="jas-container pr">'; $output .= '<h1 class="mb__5 cw">' . esc_html( cs_get_option( 'wc-page-title' ) ) . '</h1>'; $output .= '<p class="mg__0">' . do_shortcode( cs_get_option( 'wc-page-desc' ) ) . '</p>'; $output .= '</div></div>'; } elseif ( is_product_category() ) { $output = '<div class="page-head pr tc"><div class="jas-container pr">'; $output .= '<h1 class="mb__5 cw">' . esc_html( cs_get_option( 'wc-page-title' ) ) . '</h1>'; remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description', 10 ); $output .= '</div></div>'; } else { // Remove old position of category description remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); $output .= '<h1 class="tc fs__24">' . single_cat_title( '', false ) . '</h1>'; //$output .= do_shortcode( category_description() ); add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description', 10 ); } ob_start(); $output .= ob_get_clean(); echo wp_kses_post( $output ); } add_action( 'woocommerce_before_main_content', 'jas_claue_child_wc_page_head', 15 ); }
I see you added so much code in file functions.php
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
October 3, 2019 at 5:47 pm #33963
Hi Harry,
So it still shows fatal error.
The thing is when I apply mobile code only it works.
And also when I apply our first code (not mobile) it works as well.
So is there any way that we can insert the two codes separately? Maybe this will solve it.
Thanks,
FLorian -
October 3, 2019 at 10:34 pm #33966
I see you added code to My Custom Function i remove and add to claue-child > functions.php in ACE ide and it work.
Kind regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio
-
-
AuthorPosts
You must be logged in to reply to this topic.