WordPress.org

Support

Support » Plugins and Hacks » Co-Authors Plus » [Resolved] [Plugin: Co-Authors Plus] How to get Statistics of co-authors posts from DB

[Resolved] [Plugin: Co-Authors Plus] How to get Statistics of co-authors posts from DB

  • I often have guest posts on my sites and some of co-authors articles. How can I count the number of co-authors posts separately from single-author posts.

    For single-author posts I often use the following code:

    get_var(“SELECT COUNT(*) FROM $wpdb->posts
    WHERE post_status = ‘publish’ AND post_type = ‘post’
    AND post_author = ‘8’
    AND MONTH(post_date) = $this_month
    AND YEAR(post_date) = $this_year”);

    How about co-author posts?

    I have looked up the tables at wp_posts vĂ  wp_postmeta but it’s still show only one author (main author) for this post

    Thank you if anyone has solution.

    http://wordpress.org/extend/plugins/co-authors-plus/

Viewing 1 replies (of 1 total)
  • Plugin Author Daniel Bachhuber

    @danielbachhuber

    Sorry for the late reply. You’ll need to calculate posts with one coauthor term verus those with more than one co-author term. You should be able to do this by iterating through all of your posts, then doing get_coauthor() for each post, and counting how many authors are returned.

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: Co-Authors Plus] How to get Statistics of co-authors posts from DB’ is closed to new replies.
Skip to toolbar