Category description vs. SEO – important

This topic has 2 replies, 2 voices, and was last updated 5 years, 11 months ago ago by Olga Barlow

  • Avatar: grzesiekkolo
    grzesiekkolo
    Participant
    May 9, 2018 at 18:18

    Hey,

    I noticed that while there is pagination in woocommerce category the description below category is not hiding on supages (ie: category_name/page/2/ had bottom desc).

    Can you help me because it ruins SEO.

    1 Answer
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    May 10, 2018 at 09:42

    Hello,

    Install and activate child theme if you did not do it before and add the following code in functions.php of the child theme:

    function etheme_second_cat_desc() {
    		global $wp_query;
    		$cat = $wp_query->get_queried_object();
    		if ( 0 !== absint( get_query_var( 'paged' ) ) ) return;
    		if( property_exists( $cat, 'term_id' ) && ! is_search() ){
    			$desc = get_term_meta( $cat->term_id, '_et_second_description', true );
    		} else {
    			return;
    		}
    
    		if ( ! empty( $desc ) ) {
    			echo '<div class="term-description et_second-description">' . do_shortcode( $desc ) . '</div>';
    		}
    		return;
    	}

    Regards

  • Viewing 2 results - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.