Forum Replies Created

Viewing 1 replies (of 1 total)
  • hello,

    in your CPT people, you save the role in a post_meta ?

    you can filter in the wp_query like this :

    $args = array(
    	'post_type' => 'people', // your custom post type
    	'meta_key' => 'the_role', // the key of post_meta
    	'meta_value' => 'authors', // for exemple
    	'meta_compare' => '=',
            'relationship' => array( // YOUR RELATIONSHIP INFORMATION
                'id'   => 'posts_to_pages',
                'from' => get_the_ID(), // You can pass object ID or full object
            ),
            'nopaging'     => true,
    );
    $query = new WP_Query( $args );

    I hope this helps.

Viewing 1 replies (of 1 total)