Viewing 1 replies (of 1 total)
  • Plugin Author Aaron Ware

    (@aware)

    You can definitely do that.

    You can actually see an example of doing a query in the FAQs sections of this plugin.

    You’ll just need to query multiple taxonomies.

    By default the post type spotlight has it’s own taxonomy “pts_feature_tax”.

    There is a great example of taxonomy queries in the codex below

    Taxonomy Queries

    Below is an example snippet of querying posts within multiple taxonomy

    $args = array(
    	'post_type' => 'post',
    	'tax_query' => array(
    		'relation' => 'AND',
    		array(
    			'taxonomy' => 'category',
    			'field'    => 'slug',
    			'terms'    => array( 'awesome', 'sauce' ),
    		),
                    array(
                        ‘taxonomy’ => ‘pts_feature_tax’,
                        'field' => 'slug',
                        'terms' => array( 'featured' ),
                    )
    	),
    );
    
    $query = new WP_Query( $args );

    Just note that you would want to pull in the correct taxonomy/term combo for your needs and also make sure you are querying against the correct post type.

    Hope that helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Display Featured post from diferent categories/subcategories in pages?’ is closed to new replies.