Forums

Author Categories List (6 posts)

  1. TCG503
    Member
    Posted 4 months ago #

    Using WP as a multi-author blog for fiction. Each story has a category and each author may have more than one. So I need a way to list all categories that a user has posts in on the author page.

    I've looked through the codex site but can't seem to find a code for it.

    http://slpublishinggroup.com/sitenew/

  2. MichaelH
    moderator
    Posted 4 months ago #

    The template example in Author Templates will show you an author's posts and the category listed with each post...

  3. TCG503
    Member
    Posted 4 months ago #

    I think I need to clarify a bit. I don't want the posts listed just the categories that the author has posted in. The Categories store chapters for each authors stories.

  4. MichaelH
    moderator
    Posted 4 months ago #

    Guess it would be something like:

    1.Get author's posts
    2.Iterate through those posts and save the categories on each post to an array
    3. Iterate through category array to return a list of the category names.

  5. TCG503
    Member
    Posted 4 months ago #

    Any suggestion on how I'd go about doing that?

    What pages of the codex should I be looking at?

  6. MichaelH
    moderator
    Posted 4 months ago #

    1. the template tag, query_posts(), to get the posts

    2. wp_get_post_categories() to get the post categories

    3. get_categories() to get the category descriptions

Reply

You must log in to post.

About this Topic

Tags

No tags yet.