We're merging with GenerateBlocks! Learn more here.

Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support display only main cateory (meta terms) Reply To: display only main cateory (meta terms)


Hey Alex,

Give this a shot:

add_filter( 'wpsp_terms_output', function() {
    $all_terms = get_the_terms( get_the_ID(), 'category' );
    $first_term = $all_terms[0];
	$url = get_term_link( $first_term->term_id );

    return sprintf( '<span class="wp-show-posts-terms wp-show-posts-meta"><a href="%1$s">%2$s</a></span>',
} );

Let me know 🙂