Skip to:
Content
Pages
Categories
Search
Top
Bottom

Order members by specific ID set


  • Ashaw33
    Participant

    @ashaw33

    Hello, I would like to use the members loop to order a set of members specifically by id. Currently they are being displayde alphabetically using $type. Is there a way to specify the order in the $type argument by ID instead of using aphabetically, random, popular, etc?

Viewing 3 replies - 1 through 3 (of 3 total)

  • shanebp
    Moderator

    @shanebp

    Yes.
    To preserve the order, use the ‘user_ids’ parameter.
    More info.


    Ashaw33
    Participant

    @ashaw33

    Thank you, that is very helpful. I changed my args to this:

    
     $args = array(
    	'include'	    => implode(',', $users),
    	'user_ids'          => '43, 25, 187, 215, 216, 136, 31, 34, 47, 5',
    );

    If I take out the include parameter, nothing shows, but the user_ids parameter doesn’t seem to take precedence over the include parameter, so it is just ordered by id highest to lowest, not by chosen order in ‘user_ids’.

    Any idea what else I should do?


    shanebp
    Moderator

    @shanebp

    Don’t use both include and user_ids parameters.

    Use a service like pastebin to show us your code.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Order members by specific ID set’ is closed to new replies.
Skip to toolbar