WordPress.org

Forums

Co-Authors Plus
How to use WP_Query to get co-authors and args? (3 posts)

  1. sem101
    Member
    Posted 1 year ago #

    Hi, I'm trying to use WP_Query to get a list of co-authors and pass any arguments allowed. Any help? Thanks!

    $args = array(
    	'post_type' => 'post',
    	'tax_query' => array(
    		'relation' => 'AND',
    		array(
    			'taxonomy' => 'my_post_taxonomy',
    			'field' => 'slug',
    			'terms' => array( 'my-post-taxonomy' )
    		),
    		array(
    			'taxonomy' => 'author',
    			'field' => 'id',
    			'terms' => array( 103, 115, 206 ),
    			'operator' => ''
    		)
    	)
    );
    $query = new WP_Query( $args );

    P.S. I know there is a function "coauthors_wp_list_authors" but I need to use WP_Query.

    https://wordpress.org/plugins/co-authors-plus/

  2. sem101
    Member
    Posted 1 year ago #

    Can anyone please share a way to get a list of co-authors with WP_Query? Thanks in advance :-/

  3. Renato Alves
    Member
    Posted 1 year ago #

    It seems it uses the post_type "guest-authors", try to query with this.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Co-Authors Plus
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.