$ids = get_users( array('role' => 'author' ,'fields' => 'ID') );
$contr_limit = count($ids);
for($cntr=0; $cntr < $contr_limit; $cntr++){
if( pmpro_hasMembershipLevel($level_id, $ids[$cntr] ) !== true ){
unset($ids[$cntr]);
}
}
$args = array(
'author' => implode(',', $ids),
'orderby' => 'date',
'order' => 'ASC',
);
Related Posts:
- If specific user role then sticky post
- Should we trust the post globals?
- Get first post from wp_query
- Querying post from a multisite network
- How to query serialized array by comparing greater than (>=)?
- How to limit user to publish post per day and per role?
- How to know if get_posts() failed?
- Show related posts by category but ignore one category
- post__in for get_posts with a dynamic array
- Query posts distinct authors
- How to get previous 10 days post from a specific date – WP Query
- Post content being duplicated by the_content();
- Remove Posts Quick Edit link for specific user role? WP 3.3
- Specific loop in Shortcode
- Sort posts by activity date
- How to add padding between posts
- prevent showing posts of an specific category in admin posts section
- Working Bootstrap Carousel Conversion to WP – Technical Questions
- Search widget breaks when using multiple loops?
- How to change bulk post status
- Add few specific post ids to wp_query
- Multiple authors for single post without plugin
- WP_Query posts_per_page ignored
- wp_query ‘s’ parameter does not work with custom post type
- WP Query related posts by current page Tag ID
- WP Query – duplicated posts once including tags in search results
- Reset Popular post query?
- Query Posts multiple conditions
- how to get posts ids inside pre_get_posts filter?
- Future post ID not showing
- How do I use WP_Query to get a range of posts with custom fields that have numbers with letters in them?
- recent posts for different categories
- Change post order random through out the entire WordPress
- Setup a custom dynamic post
- Anyway to grab author name and featured image in an embeded in inital array of posts outside of loop?
- Removing noindex posts from wp_query
- Post visibility based on user role
- How safe is renovating $wp_query when doing WP_Query pagination in Page Template
- Exclude the first ‘n’ number of posts of a tag from home page?
- wp_query random post
- wp_posts table: safely remove unused columns to save database storage
- Using wp_list_pages() after calling query_posts()
- how to get post order by post id wp_query?
- Possible to alternate between two loops
- How to display all posts divided/ordered by post date? [closed]
- (solved) getting post author’s user role
- Why are my paginated posts always returning the same results?
- Is it possible to use WP_Query to only pull posts with attachments?
- Every second post different class in blog view
- Get posts with multiple categories
- Do not show children of a category
- Display posts of specific category term
- Hide comments and posts posted by other user
- Can’t understand why sometimes a [caption] field appears
- Display current post position in Elementor Posts widget
- Why in my query is display two title?
- wp_query with ajax
- How to give classname to post if post has no content?
- posts_per_page returning only one post
- Need to know custom code to display random and most viewed posts in wordpress posts and pages
- WP_Query custom field pass the post id
- How to convert query sql to shortcode in wordpress?
- Use posts_where to exclude posts ids from wp_query
- Why does WordPress search returns same number of results for every search query?
- Same post appears in related Posts?
- Sidebar limiting to 10 posts?
- Override WordPress core post-template.php block template
- WP_Query outputs wrong post in custom post type
- how to show comments only author which send own posts in wordpress
- Change Old WordPress Post Date Year
- Display/Filter post using if else statement
- How to sort WP_Post Object array by object field in php?
- Search results for ACF data
- Query prints posts without specific categories
- Numbered Pagination Showing The Same Posts After Altering WP_Query
- Order by meta_key field in WordPress not meta_value field value
- How to create page with post content in it?
- Administrator Posts
- allow editor/author to publish others posts but not publish their own
- Override wp_link_pages pagebreak with filter
- Loop through all posts showing duplicates
- Manipulate query to show specific post
- WordPress text field in array problem
- Random order of the 5 most popular posts
- My custom query is displaying random posts in random order
- Get query result according to merged array
- Blog only showing one post even though more published
- Sort / Filter Queries
- How to show the posts list into a static page? Problems to use the loop into a static page
- Order posts by separate menu order for different sub-categories
- Adding a category at even positions on main loop with modified pagination
- Displaying Results From Custom Taxonomy Query
- Multiple loops on a Search result page?
- What is wrong with this wp_query?
- WP_Query: Fetch posts that are in (category1 and not in category2), OR posts that are not in cagegory1
- WordPress strips some attributes for author posts
- Exclude sub sub categories from displaying in the archive page
- How do I show the post title if an advanced custom field hasn’t been used?
- How add class the_content();?
- Image inside the content is replaced with featured image from my older post