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?
User
wp queryto query posts for each author:or
and loop through each post like: