Monday, April 15, 2024

How to display category description on first page only?

add_action( 'wp', function() {

    $page = (get_query_var('paged')) ? get_query_var('paged') : 1;

    if ( 1 !== $page ) {

        remove_action( 'woocommerce_archive_description', 'shoptimizer_woocommerce_taxonomy_archive_description' );

        remove_action( 'woocommerce_archive_description', 'shoptimizer_category_image', 20 );

        // If you also want to remove the "Below category content" area:

        remove_action( 'woocommerce_after_shop_loop', 'shoptimizer_product_cat_display_details_meta', 40 );

    };

}, 20 ); 

Thursday, April 4, 2024

How to allow Html Tags in category description area.

 foreach ( array( 'pre_term_description' ) as $filter ) {
    remove_filter( $filter, 'wp_filter_kses' );
}
 
foreach ( array( 'term_description' ) as $filter ) {
    remove_filter( $filter, 'wp_kses_data' );
}

For Professional website contact WEB CODE ADDICT

View this post on Instagram A post shared by WebCodeAddict (@webcodeaddicted)