Changing order of Staff members

Support Area Forums Progress Changing order of Staff members

Viewing 4 posts - 1 through 4 (of 4 total)
URL to the page in question:
  • Author
    Posts
  • #10401
    Sarah Elliott
    Participant

    Hi Bill,

    How do you order the staff members on a page? I tried to use the “order” field but the order of the staff members on our staff type page did not change. I saw a similar question on this forum regarding changing the order of sponsorers, but I tried to change the code that you suggested but it looked as though that was already default.

    The page I’m working on is http://www.dreamlinkusa.org/staff-group/board-of-directors/

    Thank you!
    Sarah

    #10406
    Bill Robbins
    Moderator

    Sarah,

    Thank you for your business first of all. You can set things up so that your page order is reflected in the staff groups. Here’s what to do:

    1. Go to the Appearance section and select Edit.
    2. From the list of files on your right, choose functions.php and scroll down to the very bottom.
    3. Paste this:
      
      // Adds order to posts before the query is run
      	function sarah_pre_posts( $query ) {
      	
      	    if ( is_tax( 'sponsor-group' ) ) {
      	        // displays in post order
      	        $query->set( 'order', 'ASC' );
      	        $query->set( 'orderby', 'menu_order' );
      	        return;
      	    }
      	    
      	    if ( is_tax( 'staff-group' ) ) {
      	        // displays in post order
      	        $query->set( 'order', 'ASC' );
      	        $query->set( 'orderby', 'menu_order' );
      	        return;
      	    }
      	}
      	add_action( 'pre_get_posts', 'sarah_pre_posts', 1 );
      
    4. Save your changes.

    Now the order should be respected inside your sponsor and staff groups. This will be part of the next theme update. It uses a newer WordPress function to make that possible.

    You also might like to use the Simple Page Ordering plugin. It lets you drag and drop your sponsors and staff to place them in order, right from the listing screen.

    If you have any questions or trouble, let me know,
    Bill

    #10435
    Sarah Elliott
    Participant

    Thank you so much! This worked perfectly.

    #10436
    Bill Robbins
    Moderator

    So glad to hear that. If you need anything else, just let me know.

    Take care,
    Bill

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Changing order of Staff members’ is closed to new replies.