Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9136759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:59:43+00:00 2026-06-17T08:59:43+00:00

How can I list the author of a category? For example: CAT NAME: INTERNET

  • 0

How can I list the author of a category?

For example:

CAT NAME: INTERNET     AUTHOR: JOHN, DOE, ALEX
CAT NAME: TECH         AUTHOR: JOHN
CAT NAME: CODE         AUTHOR: ALEX

Any idea how to do this in WordPress?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:59:44+00:00Added an answer on June 17, 2026 at 8:59 am

    You can use the follow code:

    <?php
    $cat_arr = get_categories(); // Get the list of Categories
    foreach ($cat_arr as $cat_obj) {
        $term_id = $cat_obj->term_id;
    
        // Print the Name
        ?>
        <br>
        CAT NAME: <?php echo $cat_obj->name ?>, AUTHOR: 
        <?php
        // Get all Posts of that Category
        $posts = get_posts(array('category'=>$term_id));
    
        $authors_arr = array();
        foreach ($posts as $post_obj) {
            $author_id = $post_obj->post_author;
    
                // In depends on where you put this code, the include of the file is required
            if (!function_exists('get_userdata')) {
                include '<your WP folder>/wp-includes/pluggable.php';
            }
    
            $user_obj = get_userdata($author_id);
                // Only Add the author is isn't already added, to avoid printed twice
            if (!in_array($user_obj->user_login, $authors_arr)) {
                $authors_arr[] = $user_obj->user_login; // Instead of user_login you can use any Database field of the "Users" table
            }
        }
        echo implode(', ', $authors_arr) . '<br>';
    }
    ?>
    

    But if you want do this for the “current” Category (not for all Categories) you can use the follow code:

        $cat_obj = get_the_category(); // This is what you put in your comment to get Current Category
    
        $term_id = $cat_obj->term_id;
    
        // Print the Name
        ?>
        <br>
        CAT NAME: <?php echo $cat_obj->name ?>, AUTHOR: 
        <?php
        // Get all Posts of that Category
        $posts = get_posts(array('category'=>$term_id));
    
        $authors_arr = array();
        foreach ($posts as $post_obj) {
            $author_id = $post_obj->post_author;
    
                // In depends on where you put this code, the include of the file is required
            if (!function_exists('get_userdata')) {
                include '<your WP folder>/wp-includes/pluggable.php';
            }
    
            $user_obj = get_userdata($author_id);
                // Only Add the author is isn't already added, to avoid printed twice
            if (!in_array($user_obj->user_login, $authors_arr)) {
                $authors_arr[] = $user_obj->user_login; // Instead of user_login you can use any Database field of the "Users" table
            }
        }
        echo implode(', ', $authors_arr) . '<br>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way that I can list the pages which are currently stored
SELECT name FROM sys.databases -- this can list all database name in the server
As you can see near the end of the code, i use list.printList that
[Book] isbn(PK),title,category_id,subcategory_id,price [Author] isbn(FK),author_id(PK),name [Category] category_id(PK),name [SubCategory] sub_category_id(PK),category_id(FK),name I have a database (not designed
Is there a way that I can list, by author, and by activity (what
I can list my own computer's shares no problem with: gwmi Win32_Share But when
Is there a tool that can list the exact versions and public keys of
I need a control that can list data in 3 columns, I want to
I want to create a marketplace where users can list items and have buyers
I'm having a go at mod_rewrite so that the client can list better urls

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.