• I’m running a blog for a college course where students are required to post across three categories throughout the semester. They’re trying to post somewhat evenly across the board, so I wanted a visual cue on their author page for them to see where they’re posting.

    I know how to get the number of posts for a category, and I know how to get the number of posts for an author, but I cannot for the life of me figure out how to get the middle-of-the-venn-diagram bit of information that I need here.

    So, I’d like the top of their author page to read

    John Smith
    CAT1 – 12 | CAT2 – 3 | CAT3 – 8

    If it makes any difference, they’re accessing the blog through the Facebook Connect plugin.

    Is this possible?

    Thanks!

Viewing 1 replies (of 1 total)
  • Thread Starter meglish

    (@meglish)

    Alright, I came up with this work-around, which works exactly for my situation, but doesn’t result in variables you can use elsewhere.

    Since I only needed these stats on the author pages, and since I know the authors in question will only write 25-30 posts (if that), I went ahead and added the Per Page plugin to change the author pages so that they’d display up to 100 posts. Then I stuck a counter in the loop to count up the posts:

    if ($cat->cat_ID=='9') {
    $engcount = $engcount + 1;

    And so on. I already had the posts displaying in different colors based on the same category conditions, so tucking that counter in was straightforward.

    Instead of displaying the totals at the top, I wiggled with the CSS a little so that the sidebar came after the main content, and the totals now appear in a modified version of the sidebar.

    So, my needs are met for this project, but I’m still curious if there’s a different way to just grab that information from somewhere, without having a loop count.

    Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Get Number of Author Posts Broken Down by Category?’ is closed to new replies.