Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter sunamumaya

    (@sunamumaya)

    Also, it would really help to be able to do this check in queries, e.g. to exclude co-authored posts from author template pages.

    Thread Starter sunamumaya

    (@sunamumaya)

    Anyone?

    This is pretty important, since not excluding the co-authored posts from author archive pages may result in a lot of duplication (same post shows in main archive, and in all co-authors’ author archives; if you have three co-authors for an article, that’s four places where that article shows up).

    I have managed to use a pre_get_posts filter used exclusively on the author archive pages, using a taxonomy query like this:

    `$tax_query = array(
    array(
    ‘taxonomy’ => ‘author’,
    ‘field’ => ‘name’,
    ‘terms’ => $query->query_vars[‘author_name’] ,
    ‘operator’ => ‘NOT IN’
    )
    );`

    This trick basically makes sure the current author is not among the co-authors of their own articles, which should be true for all articles that are not co-authored, if the ‘author’ taxonomy is not set AT ALL for those articles.

    Trouble is, the plugin seems to set the ‘author’ taxonomy for all new single-author articles anyway, even if they are not co-authored. This renders the above solution useless.

    Any other ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Quick Way to Determine if a Post is Co-authored?’ is closed to new replies.