If posts are restricted to a specific role users are required to have, you must add some piece of metadata to the post. Else, WP won’t know which posts you mean.
There’s a standard box for adding metadata to your post (select ‘custom fields’ under ‘screen option’ in your edit screen), or you could create your own metabox or (easier) taxonomy. From your question I gather you already considered the latter option and thought it too cumbersome. But there’s no way to escape putting some tag on the post telling the system which ones are meant for which type of user.
Once there is some metadata on the post, you can query for it.
Related Posts:
- Hide posts from users with a specific role
- How to order posts by custom WP role?
- How to hide post content/meta from everyone except the post author and admin
- SQL User Query by Multiple Roles using PHP
- How to order posts in wp_query by the user role (2 roles in array)
- How to display user order by role
- How can I query users by custom role?
- REST API: Limit Read Permissions for Default Endpoints
- Why does get_posts only show results for Admins or logged-out users?
- Show menus to one admin username
- Link Author URL’s based on a custom field
- Meta query orderby meta_value_num sorting by role first
- Set “editor” role to existing user
- Pre_get_posts only show posts by administrator roles
- Displaying content to search engines but via navigation only for registered users.
- Get users query makes the site loading time too big?
- How to know which editor published a post programmatically?
- When to use WP_query(), query_posts() and pre_get_posts
- How to get an array of post data from wp_query result?
- How to only display posts whose meta_value field is not empty?
- WP query taxonomy input differs to output?
- How to add taxonomy filter on the query fly?
- How to get Page/Post Gallery attachment images in order they are set in backend using WP_Query()?
- What exactly does the ‘s’ parameter search for in WP queries?
- WP_Query min and max values
- post_type is ignored by WP_Query when ‘tag’ argument is included
- How to query posts of standard post format. For real
- get query’s query string
- Show only oldest post by author
- assign 2 $args to one wp_query
- WP_Query OR clause for tax_query and keywords
- Calling a custom excerpt function in a local loop
- Transient pagination not working properly
- query posts in functions.php and update a field
- Which filter/action hook gets triggered after a query has been performed?
- How to check if a role has a specific capability
- Modify existing query and change order of posts
- Why query_vars get altered in WP_Query Object?
- Why does the_content not work like others for a set post id?
- pre_get_posts filter meta_query without conflicting existing meta_query
- How would I format a query that depends on post parent taxonomy
- Minimising Database Queries when using Advanced Custom Fields
- WP_Query Group by Author and Order each group DESC
- List only posts from specific category on category page
- Most popular post for last 7 days
- WP Pagination on Posts Search Results Page resulting from AJAX WP Query
- How to avoid wp_query returning the same post I’m on in results?
- Are User Levels Still Currently Used?
- Query multiple meta values
- Why isn’t my multiple orderby working?
- WordPress Loop and $post
- How can I create ‘future’ and ‘past’ parameter for restAPI by filtering the CPT custom date field by greater than / less than current datetime?
- WP_Query tax query part of slug
- WP_Query() order by post content lenght?
- Query posts without meta preload
- How to implement a new row_count method in WordPress?
- reset to main loop doesnt work
- Applying posts_clauses filter to specific queries only
- Shortcode for latest -not expired- posts
- Limit a user to have access to only specified pages?
- meta_compare not comparing whole integer
- WP_Query – Object manipulation vs WordPress functions
- Only display post if published in last 24 hours?
- WP_Query with rewind_posts creates duplicate titles
- Transients with dynamic WP_Query
- How to remove the most recent post from $the_query
- WP_Query loop else statement not executing
- Selecting posts with a given meta value for a meta key
- pre_get_posts – editing query, tax_query
- Check if a post has term inside loop
- Display all posts in a custom post type, grouped by a custom taxonomy. How to sort the posts alphabetically and the terms by ID?
- Hacking ‘posts_per_page’ in WP_Query
- ajax wp_query conditional tags not working
- Comparing 2 Decimal Numbers from custom fields and displaying posts
- Query outputting YouTube url rather than embedded video
- max_num_pages says 4, yet I am only able to navigate to the third page
- wp list pages using meta box value
- get_var is neither a string, integer, or array …?
- Can I get one wp_query to double order like this?
- paginate_links appearing on page but it doesn’t actually paginate – pagination on a static page with a dynamic `post_type` argument on a static page
- Sort custom post by custom field if none order by latest release
- Form checkbox value going to dynamic URL
- show most viewed post
- WordPress Carousel with recive posts (Bootstrap)
- Custom query showing all acf field values instead of the one searched
- posts_per_page in a tax_query
- Modify a query with no results in pre_get_posts
- Updating an intensive wp_query result once daily
- Custom WP_query and integrating into theme file
- Filter custom post type by custom taxomony
- Query post Pagination Problem
- Why does order ASC break offset in WP_Query?
- new WP_query using custom fields
- Having Trouble Running Query From Shortcode Using Tribe’s Events Plugin
- Change ‘post_modify’ with a query
- An archive page without post format (just standard post)
- Pull Instagram images into an existing loop?
- Pagination showing same posts despite changing page
- shortcode with $atts with strange results
- Query custom post types by meta field in a term from custom taxonomy