Staff not showing in order

Support Area Forums Agency Staff not showing in order

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
URL to the page in question:
  • Author
    Posts
  • #16998
    Justin Smoker
    Participant

    When I am editing my staff list, I have assigned each an “Order” number, and they show up in the correct order on the editing page. On the actual website, the order seems to be completely random, with no way to affect what order they’re displayed in. Am I missing something with the ordering? http://www.alphassoc.org … The President and President Elect should be the first two shown.

    #17002
    Bill Robbins
    Moderator

    Hello Justin,

    Great question. In the version of the theme that being run there, the staff groups would not respect the “order numbers” but would instead go with the WordPress default (reverse chronological). If you added the staff list via the staff page template, then it would follow the order.

    There are two ways to make the staff groups also follow the order. You can update to the current version of the theme. It adds in support for ordering of staff group members (among other things).

    The other way would be to make a theme edit. Here’s how to do that:

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

    That should cause the staff group members to be ordered via the number. Since the default is 0, you’ll have to add a number for every member in order for that to work. You might try the Simple Page Ordering plugin which will let you drag and drop your staff members to set the order. You can change the number of staff shown on a page in your control panel in the screen options tab. With a long list, you’ll probably have to do that to make drag and drop effective.

    Let me know if you have any trouble,
    Bill

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Staff not showing in order’ is closed to new replies.