Home › Forums › Themes Support › Claue › How to move category description text before products listings
- This topic has 16 replies, 3 voices, and was last updated 3 weeks, 5 days ago by solarzmr.
-
AuthorPosts
-
-
September 27, 2023 at 2:14 pm #44098
-
September 27, 2023 at 9:53 pm #44100HarrySupport Expired
Hi Cata,
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’ );
$output = ‘<div class=”page-head pr tc”><div class=”jas-container pr”>’;
if ( is_search() ) {
$output .= ‘<h1 class=”mb__5 cw”>’ . sprintf(__( ‘Search Results for: %s’, ‘claue’ ), ‘<span>’ . get_search_query() . ‘</span>’ ) . ‘</h1>’;
} elseif ( is_shop() ) {
$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>’;
} 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>’;
//$output .= do_shortcode( category_description() );
add_action( ‘woocommerce_after_shop_loop’, ‘woocommerce_taxonomy_archive_description’, 40 );
add_action( ‘woocommerce_after_shop_loop’, ‘woocommerce_product_archive_description’, 40 );
}
ob_start();
$output .= ob_get_clean();
$output .= ‘</div></div>’;echo wp_kses_post( $output );
}
add_action( ‘woocommerce_after_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-
November 8, 2024 at 6:01 pm #44526solarzmrSupport Expired
Hi, I also want to move description below products at category page. I tried paste your code, but wordpress shows syntax error, unexpected token “class” at line 36, and don’t want to save file functions.php.
This is line 36 at my functions.php:
$output = ‘<div class=”page-head pr tc”><div class=”jas-container pr”>’;
- This reply was modified 3 weeks, 5 days ago by solarzmr.
-
November 8, 2024 at 9:09 pm #44529HarrySupport Expired
Hi,
The code above you copied not correct format. Please use below code
/* 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' ); $output = '<div class="page-head pr tc"><div class="jas-container pr">'; if ( is_search() ) { $output .= '<h1 class="mb__5 cw">' . sprintf(__( 'Search Results for: %s', 'claue' ), '<span>' . get_search_query() . '</span>' ) . '</h1>'; } elseif ( is_shop() ) { $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>'; } 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>'; //$output .= do_shortcode( category_description() ); add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description', 40 ); add_action( 'woocommerce_after_shop_loop', 'woocommerce_product_archive_description', 40 ); } ob_start(); $output .= ob_get_clean(); $output .= '</div></div>'; 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-
November 8, 2024 at 9:52 pm #44530solarzmrSupport Expired
I paste this code, but description is still above products
-
November 8, 2024 at 11:40 pm #44531HarrySupport Expired
Hi,
Please add below code to claue-child > functions.php
add_action( 'wp_head', 'remove_my_action' ); function remove_my_action(){ // Remove old position of category description remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); remove_action( 'woocommerce_before_main_content', 'jas_claue_wc_page_head', 15 ); add_action('woocommerce_after_main_content', 'woocommerce_taxonomy_archive_description', 5 ); } 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' ); $output = '<div class="page-head pr tc"><div class="jas-container pr">'; if ( is_search() ) { $output .= '<h1 class="mb__5 cw">' . sprintf(__( 'Search Results for: %s', 'claue' ), '<span>' . get_search_query() . '</span>' ) . '</h1>'; } elseif ( is_shop() ) { $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>'; } else { $output .= '<h1 class="cw">' . single_cat_title( '', false ) . '</h1>'; } ob_start(); $output .= ob_get_clean(); $output .= '</div></div>'; echo wp_kses_post( $output ); } add_action( 'woocommerce_before_main_content', 'jas_claue_child_wc_page_head', 15 );
and below code to Claue > Theme Option > General Layout > Custom CSS
.term-description { display: block; width: 100%; max-width: 1170px; margin: 30px auto; }
Kind regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
November 9, 2024 at 12:12 am #44532solarzmrSupport Expired
Thanks, now it works 🙂
-
-
-
-
September 27, 2023 at 9:59 pm #44101cata78Support Expired
I added it in main theme functions.php and it moves only the title without description. Description disappeared.
-
September 27, 2023 at 11:00 pm #44103HarrySupport Expired
Can you send me your site url to check?
Btw, your support expired. Please renew your support at https://themeforest.net/downloads
Thank and regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
September 28, 2023 at 2:42 pm #44104cata78Support ExpiredThis reply has been marked as private.
-
September 28, 2023 at 10:49 pm #44105HarrySupport Expired
Please send admin account? I need to check bẻoe give you solution.
The support will help us continue improve and update new features for our theme.
Kind regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
September 29, 2023 at 11:43 am #44106cata78Support ExpiredThis reply has been marked as private.
-
September 29, 2023 at 9:41 pm #44108HarrySupport Expired
Hi,
- I check your site and activate child theme, it now the site error.
Can you send me FTP account to fix?
2. On the laptop resolution less than 1024px it will change to 2 cols
Thanks
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
September 30, 2023 at 3:34 pm #44109HarrySupport Expired
Hi,
I help you correct the code in claue-child > functions.php
Please check.
Kind regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
October 1, 2023 at 11:34 pm #44116HarrySupport Expired
Hi,
I not good for url friendly, please try a plugin Rankmath or Yoast Seo.
Kind regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
October 2, 2023 at 3:53 pm #44120HarrySupport Expired
Hi,
I just edit code in child theme.
Kind regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio -
November 8, 2024 at 9:06 pm #44528HarrySupport Expired
Hi, I also want to move description below products at category page. I tried paste your code, but wordpress shows syntax error, unexpected token “class” at line 36, and don’t want to save file functions.php.
This is line 36 at my functions.php:
$output = ‘<div class=”page-head pr tc”><div class=”jas-container pr”>’;
Hi,
Please edit code and use below code
/* 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 ); remove_action( 'woocommerce_single_product_summary', 'jas_claue_wc_single_social_share', 50 ); } function jas_claue_child_wc_single_social_share() { if ( cs_get_option( 'wc-social-share' ) ) { echo '<h3>Condividi su</h3>'; jas_claue_social_share(); } } add_action( 'woocommerce_single_product_summary', 'jas_claue_child_wc_single_social_share', 50 ); 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' ); $output = '<div class="page-head pr tc"><div class="jas-container pr">'; if ( is_search() ) { $output .= '<h1 class="mb__5 cw">' . sprintf(__( 'Search Results for: %s', 'claue' ), '<span>' . get_search_query() . '</span>' ) . '</h1>'; } elseif ( is_shop() ) { $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>'; } 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>'; //$output .= do_shortcode( category_description() ); add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description', 40 ); add_action( 'woocommerce_after_shop_loop', 'woocommerce_product_archive_description', 40 ); } ob_start(); $output .= ob_get_clean(); $output .= '</div></div>'; echo wp_kses_post( $output ); } add_action( 'woocommerce_before_main_content', 'jas_claue_child_wc_page_head', 15 );
The code you copy above not correct format.
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.