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 6947969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:45:41+00:00 2026-05-27T13:45:41+00:00

How can I list posts as sub-items of authors? It should look like: <ul>

  • 0

How can I list posts as sub-items of authors? It should look like:

<ul>
    <li>Author</li>
        <ul>
            <li>Post1</li>
            <li>Post2</li>
        </ul>
    </li>
</ul>

I have an array containing author data including $author->ID. This comes from get_users().
My function looks like this:

function add_custom_menu_items($items, $args) {

    $authors = get_users('role=author'); \\Returns array of author meta-data.

    return $items.$authors_str;    
}
add_filter( 'wp_nav_menu_items', 'add_custom_menu_items', 5, 2);

Where can I get a list of posts?

  • 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-05-27T13:45:42+00:00Added an answer on May 27, 2026 at 1:45 pm

    User wp query to query posts for each author:

    $the_query = new WP_Query( 'author=123' );
    

    or

    $the_query = new WP_Query( 'author_name=rami' );
    

    and loop through each post like:

    // The Loop
    while ( $the_query->have_posts() ) : $the_query->the_post();
        echo '<li>';
        the_title();
        echo '</li>';
    endwhile;
    
    // Reset Post Data
    wp_reset_postdata();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a TableView(Grouped Table View). And I can list the items in
For example, I can have documents like: doc1 = { title: First blog post,
I have a list of posts and an edit link for each. When clicking
In an ASP.NET MVC3 application I have a function that looks like: Public Sub
I have a Model object with a List collection of sub objects. I need
How can i do an Ajax Post with a dropdown list? For example, I
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
Is there any way that I can list the pages which are currently stored

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.