Staff Sort Order

Support Area Forums Authentic Staff Sort Order

Viewing 2 posts - 1 through 2 (of 2 total)
URL to the page in question:
  • Author
    Posts
  • #11582
    Jeff Caldwell
    Participant

    I have added the staff but I cannot get them sorted in the order I would like them to show. I have tried to use the sort option on the lower right side of the staff page but no go. How can we sort the staff in a different order then when I enter them.

    #11584
    Bill Robbins
    Moderator

    Jeff,

    Good question. WordPress defaults to displaying items in reverse chronological order (like how posts are displayed in a blog typically). They’ve recently introduced a new function that allows us to alter that behavior. It’ll be in the next version of Epic, but you can add it to the current one. Here’s how:

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

    That will let you sort the staff members by their order number. You can then use the Simple Page Ordering plugin to drag and drop them to set the order.

    Let me know if I can help,
    Bill

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Staff Sort Order’ is closed to new replies.