I want to display users of wordpress as a table just like
https://stackoverflow.com/users
The recommended function is wp_list_authors, but it is not clear how can customise
the layout.
Say I want to display users in cells of table 5 x 5 with get next page link.
Please advice.
Let me explain a bit.
Unlike get_users_of_blog wp_list_authors does not return an array. If it would – then
having an array I can build any table using foreach. But wp_list_authors builds anchor tags on its own and returns monolith html block. The only option to control layout would be passing some sort before and after tags. But this function does not provide this sort of functionality.
As far as i know, there’s no function like
get_authors(), but you can do it by a raw SQL query in a custom template:Update: For pagination
I’m not sure if you can use the built-in WordPress pagination to do that, as the
pagedparam only appear to posts. You could fill a global $post var in a loop or something… There’s a lot of approaches, but let’s go for the “PHP” one. =DTo simulate the table appearance, just float “someclass” left and put a fixed width on it. The “padder” div (float left and width 100%) will ensure that the cells will be aligned by the highest one in that row.
And for the pagination links:
Code from brain to keyboard. Not tested, again.
Hope it helps.