mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-30 11:42:22 +08:00
https://stackoverflow.com/questions/77396572/remove-description-from-displaying-on-woocommerce-main-shop-page
9 lines
446 B
Text
9 lines
446 B
Text
remove_action( 'woocommerce_archive_description', 'woocommerce_product_archive_description', 10 );
|
|
add_action('woocommerce_after_main_content', 'add_shop_page_description');
|
|
function add_shop_page_description(){
|
|
if (is_product()){
|
|
$shop_id = wc_get_page_id('shop'); // replace woocommerce_get_page_id() with wc_get_page_id()
|
|
$content = get_the_content(null, false, $shop_id);
|
|
echo apply_filters( 'the_content', $content );
|
|
}
|
|
}
|