WordPress does not have relationship support among the posts. So for you to do that you have create a new table to store the post id and the linked post id. You need to do custom query every time that table needs to be updated.
Related Posts:
- Order post by year DESC and month ASC
- Exclude posts with empty post_content in wp_query
- Improving WP_Query for performance when random posts are ordered
- posts_per_page option limits the number of Gallery items
- Counter is skipping post when I still want it visible [closed]
- Query for first 3 posts to change the look and feel
- How to give classname to post if post has no content?
- How to fetch courses in all languages in WordPress?
- Show 5 posts and than 3 posts offset with pagination
- Querying posts from current category, using a variable as array argument
- Sort Events by Venue Title – Sort Post set by related post ids
- Sort / Filter Queries
- Query post category & remove any post id
- Ordering posts alphabetically by meta keys and title
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- How to limit post query to only return a total count of items with certain post statuses?
- Sort Posts Alphabetically Based on Specific Category (Divi)
- Keep featured content post in homepage with original order
- Query posts from current year
- Number of posts per page setting is not working?
- Can’t show comments count per post outside loop
- Should ‘setup_postdata()’ be reset with ‘wp_reset_postdata()’?
- wp_enqueue_media() slows down my WP site
- How can I get all posts data from within a paginated search result?
- Function to show random posts from a category
- Query posts from different categories in multisite
- posts_per_page doesnt work
- Sorting posts according to view counts not working
- Only display posts after current date
- WP_Query Authors OR Categories
- Get Posts that are in the current month or later
- How To Get Posts With A Specific Word
- do_shortcode within post query
- Why WP_Query(‘showposts=5’) shows only 1 post?
- Most liked page not displaying posts
- Why is querying posts messing up my pages?
- Display all posts that were published before full post on single.php
- Query get post,how to add comment box
- get query() without post content?
- How can I setup a relationship using categories in WordPress?
- Multi row post list
- How i can limit period of post publication?
- Exclude current custom post on single post
- Nested WP_Query breaking loop
- Dynamically switch template on click
- Get all custom post types excepted some…
- Get all comments of author’s posts
- Why Query is returning empty array?
- Wrap every month posts in div
- meta_value timestamp older than now
- Do not show children of a category
- post__in not working with pre_get_posts, but post__not_in does work
- Query posts and filter at query time by value of custom meta
- Very complex post query
- Delete post revisions only for a single post
- On what hook can I get the queried object’s final state?
- Get the most recently modified post date of most recently modified post
- Queries take 120+ seconds on my large WordPress site
- How to retrieve certain number of images from a wordpress post?
- WordPress post filter menu
- Some doubts about how the loop work (trying debugging it)
- WordPress query portfolio posts
- How to get posts ordered by using their categories?
- Display 3 posts with different HTML markup using a loop
- Getting posts from some categories plus some individual posts
- How to assign a post to a post parrent?
- query for filtering published posts?
- Trying to exclude custom posts based on date, while sorting by custom field
- get parent fields title, content excerpt etc
- AWS usage queries
- Pull in posts using post meta for REST API
- How to optimize posts query in wordpress
- Query to fetch custom taxonomy along with post title
- How to search through “post title” and “tags” using WP_Query?
- How to show post views shortcode data for each post on Posts List Page?
- Need to display a Jan 1st post as the site’s front page on Jan 1st, and Jan 2nd post as front page on Jan 2nd etc
- I have two post types in the same query, how can I use CSS to select only one post type?
- How can I use query_posts to loop through posts and construct my own content?
- Assign a day of the week to post, e.g: Assign Monday to post and have it only appear when the day is Monday
- I need some explanation on global $post [duplicate]
- WP_Query to get posts in a specific tag or has post_format
- Make recent post display recent updated, instead of recent published
- Numbering author posts in posts query
- How to run select query of post with category and tags?
- Query posts from newest category
- Need help writing loop to display posts by categories in separate divs
- Custom Select Query pagination not working properly
- get_page_by_title() not working if special characters are present
- Modify WordPress loop after it has been run
- Grab next post title in archive page
- How do I control the fallback query after the original query returned cero posts?
- Remove duplicated posts in the loop if post has more than one category
- Continuous listing from a custom field
- Adding a category at even positions on main loop with modified pagination
- How to store post rating system data post independent?
- Get first comment link on the post itself
- Not displaying any articles on a custom made file
- Need to show birthday of custom post type(Famous people in this case) in elementor. Date of birth set in custom fields
- Change permalinks in posts via SQL