6

I'd like to display a grid of authors on my site showing the name of the author and their avatar. The tricky part is, I'd like to be able to control this from the Menus page in the dashboard so I have control over who is displayed and in what order they are displayed.

Is this doable? I don't think a custom walker would work in this situation as it wouldn't allow for arbitrary order and selection control. So my next thought is how to add another selector on the menus page for authors. Any help?

3
  • 2
    Walker doesn't control order and selection, it just turns supplied hierarchical data into resulting output.
    – Rarst
    Commented Oct 28, 2013 at 18:50
  • So the next option would be to try to hook into the metabox on the Menus page, agreed?
    – javy
    Commented Oct 28, 2013 at 18:59
  • 1
    If going for the next option: wordpress.stackexchange.com/q/101710
    – brasofilo
    Commented Oct 28, 2013 at 19:13

2 Answers 2

0

I don't really understand why you want to use a menu to control this but it wouldn't be very hard. First you obviously need a new page template for your grid which you will use get_users to pull your users for display - https://codex.wordpress.org/Function_Reference/get_users

Now if you want to control the order and whom is included in the grid via a menu what you would do is use the function wp_get_nav_menu_items() to get the items of your menu so that you can loop through the items and update the include parameter of get_users accordingly based on your menu items.

0

I think you are getting confused about how you would control a grid of authors on a page. It's not something you would control through the menus part of WordPress as that is designed to simply be used with menus only and not the main content on the page. I would suggest finding a plugin that you can use as a block or widget on your site to select your authors from your complete list. I'm unfamiliar with one of these off have but it may be something someone has made before. This one seems to work quite well; for example, you may be able to customise it for your needs... link to popular post's author's plugin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.