WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Author Listings for a Child Site (5 posts)

  1. Arley McBlain
    Member
    Posted 1 year ago #

    Hello! I'm looking to create an Author Listings page on child sites to list the users of only the respective site. Naturally the issue with Multisite is that the following query will list all users in the network since WPMU has one user table:

    $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users WHERE display_name <> 'admin' ORDER BY display_name");

    I'm told I need to add a blog ID in the above; but I'm not sure what that syntax should look like. I've tried digging through the database to understand the data structure better, but I can't seem to find where specific users are "assigned" or given permissions on a child site, so I'm having trouble figuring out what this query should be!

  2. They'd only be the users on that blog, so you can get users per blog and sort by author.

    I think this guy did it: http://wordpress.org/support/topic/multisite-list-users?replies=4

  3. Arley McBlain
    Member
    Posted 1 year ago #

    Perfect! I did make a change I thought I'd save here for posterity. I changed my shortcode to be dynamic instead of a hardcoded ID:

    global $blog_id;
    echo do_shortcode('[contributors blognumber="'. $blog_id .'"]First Blog[/contributors]');

    Thanks Ipstenu! I don't ask questions often on the forum, but you have answered many for me! :D

  4. Awesome! And thank you for sharing the fix :D (You're welcome to answer any question you know, I love seeing more people ;) )

  5. Arley McBlain
    Member
    Posted 1 year ago #

    Bully ;)

    I went and tackled three; that's not so scary! Thanks for giving me the push.

Topic Closed

This topic has been closed to new replies.

About this Topic