5

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?

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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