WordPress.org

Ready to get started?Download WordPress

Forums

Simple Staff List
Ramdomize the Staff Member Order (5 posts)

  1. kdsamra
    Member
    Posted 1 year ago #

    Hi Brett,

    I really appreciate the great plugin and the support you provide. I was wondering if there is a way I could generate the staff members in random order. So that each time you load the page the people would be listed randomly.

    I'm not a PHP expert but I can modify the php with some guidance.

    Here again, are the links to my staff member lists:

    http://lokafy.com/paris/

    http://lokafy.com/toronto/

    Please let me know if this would be easy to do.

    Thanks,
    Kiran

    http://wordpress.org/extend/plugins/simple-staff-list/

  2. Nick Ciske
    Member
    Posted 11 months ago #

    On line 28 of user-view-show-staff-list.php change menu_order to rand.

    $args = array( 'post_type' => 'staff-member', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'post_status' => 'publish' );

    TO

    $args = array( 'post_type' => 'staff-member', 'posts_per_page' => -1, 'orderby' => 'rand', 'post_status' => 'publish' );

    Note: You'll have to redo this change if you update the plugin.

  3. Nick Ciske
    Member
    Posted 11 months ago #

    Note to plugin author: this would be a great place for a filter on the $args ;-)

  4. kdsamra
    Member
    Posted 11 months ago #

    Amazing! That was so easy.

    Thanks so much Nick.

  5. Nick Ciske
    Member
    Posted 11 months ago #

    WP_Query is an amazing thing ;-)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags