Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Show posts in current category and specific tag Reply To: Show posts in current category and specific tag

#13771
Tom
Keymaster

How are you defining primary categories?

You can use any of the WP_Query parameters: https://developer.wordpress.org/reference/classes/wp_query/

$terms = get_the_terms( get_the_ID(), 'category' );

if ( !empty( $terms ) ){
    // get the first term
    $term = array_shift( $terms );
    $term_slug = $term->slug;
}

$args = array(
    'tax_term' => $term_slug,
);

wpsp_display( 1234, $args );