Community Support Forums — WordPress® ( Users Helping Users ) — 2011-04-11T07:08:39-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=3073 2011-04-11T07:08:39-05:00 http://www.primothemes.com/forums/viewtopic.php?t=3073&p=9469#p9469 <![CDATA[Re: Querying Members in A Level]]> Statistics: Posted by cspowers — April 11th, 2011, 7:08 am


]]>
2011-04-11T04:20:52-05:00 http://www.primothemes.com/forums/viewtopic.php?t=3073&p=9462#p9462 <![CDATA[Re: Querying Members in A Level]]> Thanks for the excellent question.

You might try something like this.
Code:
<?php
$array 
= array ();

foreach (get_users ("role=s2member_level1") as $user)
    $array[] = $user->ID;

$leaderlist = implode (",", $array);

$args = array ("orderby" => "date", "order" => "DESC", "paged" => $paged, "author" => $leaderlist);

$wp_query = new WP_Query ($args);
?>
Reference article: http://codex.wordpress.org/Function_Reference/get_users

Statistics: Posted by Jason Caldwell — April 11th, 2011, 4:20 am


]]>
2011-04-10T16:32:39-05:00 http://www.primothemes.com/forums/viewtopic.php?t=3073&p=9436#p9436 <![CDATA[Querying Members in A Level]]>
I'm very new to WP and S2 Member. Currently using the free version but am planning up going with S2 Member Pro.

I want to create a "page of posts" using a fairly standard version of the loop. But what I want to accomplish is that the page of posts contains only the posts that are _authored_ by members of a particular level.


Code:
$leaderlist = S2functionhere("LeaderLevel");
//diyc
$args = array(
   'orderby' => 'date',
   'order' => 'DESC',
   'paged' => $paged,
   'author' => $leaderlist, //diyc
);
$wp_query = new WP_Query($args);


What's the best way to build a list of IDs of users in a particular level?

Statistics: Posted by cspowers — April 10th, 2011, 4:32 pm


]]>