2 possible solutions spring to mind, both fairly straightforward:
- Use a custom taxonomy to create groups then add the accessories and main product to the same group
- Add an interface that updates the post_parent field to mark items as accessories for a specific product
With either of these approaches you get a fairly easy way to group the products together although the taxonomy approach allows for more flexibility if there are accessories that could be used for multiple products.
Related Posts:
- Get The Post Type A Taxonomy Is Attached To
- Meta query with boolean true/false value
- Custom Post type & Taxonomy URL structure
- Why does my custom WP role need edit_posts to edit images?
- Custom Post Type – Taxonomy Dropdown Menu?
- Set custom upload path for custom post type only?
- Two Custom Post Types, Share Two Taxonomies
- Multisite wide post type?
- Remove CPT slug from URL
- Date query for a custom meta field
- WordPress metabox file upload in custom post [duplicate]
- tags & categories with custom post type
- Querying Posts by Taxonomy From Alternate Network Site
- How to show custom post type count in the users admin page
- Archive filter disappears on no results?
- Importing posts in custom post type into new website
- Timepicker-addon doesn’t show – Datepicker works fine?
- Registration and Custom Post Types – How to synchronize information?
- different template for first and second level custom post page
- Query for multiple post types does not work
- How-to leverage WordPress for creating Extended Social Profiles
- Add custom post type to Backbone collections
- pagination redirecting from page number url before page requested
- Get all of user’s custom post types in WP Admin for plugin
- How To Create A Custom Taxonomy 404 Page
- Query Multiple Taxominies Across Multiple Post type’s
- Does anyone have a plugin that could automatically tag custom post types in wordpress?
- How to enable shortcodes in a custom post type?
- Ajax Check Post Status
- Stop / prevent WordPress from updating permalinks of custom post type
- How can I dynamically add a post to a custom post type which uses a custom field?
- Allow non-logged in users to see a future post after clicking on a list of future posts
- How can we take into account post types when constructing permalinks?
- Posts Categories Are Showing In The Custom Post Type Category
- Custom post type showing index.php
- ACF From & To Date Validations
- Get post count for search result based on post type
- Modification of how the data is controlled/showed and stored
- How to run filter only on custom post type edit screen
- Show fields based on taxonomy selection in editor
- cannot override post_types in WP_Query()
- Wrapping x posts in html without leaving empty html
- Page not found for custom post type UI plugin and taxonomy
- How to Get the title of a custom field?
- Loop for custom post types filtered by a taxonomy
- How to customize work area / admin area in a custom post type without plugins?
- Post loop count is not in order
- Displaying custom post types by category
- Disable custom taxonomy on admin bar
- Insert Custom Post Types
- How to inherit field value from parent post into in child / sub post
- how to show records that don’t have custom meta value
- Want a custom query with just one category but from all custom post types
- WordPress CPT custom custom label
- How do you output an unknown number of images in a custom post type with desired markup?
- Filter content in shortcode
- If Post type use sidebar (‘tree’)
- Using Image Sizes for Custom Post Types outside the Loop
- How should I structure complex content hierarchies?
- Convert Custom Taxonomy Posts to Normal Posts
- Sort column on meta key and meta value
- Function to return values from metabox
- Custom menu breaks down
- Wp Meta Query does not work while simple Query Works
- ForEach Loop iterates only once when inserting product variations
- How to embed script in custom post type with dynamic value
- How to set post date in post_type so that it’s same as latest post in category
- Is there a way to use ‘publicly_queryable’ => false only on specific taxonomy term?
- Add two custom product type
- Adding a Custom Post Type
- multiple section
- How to add dynamic fields on wordpress custom post type page in admin section
- How to use POST method using custom wordpress button?
- Add %post_id% to slug of custom post type and prevent the “unique slug” thing that WP does?
- “A post type mismatch has been detected” Error when updating custom post
- Custom fields for taxonomies with custom value for each post
- Not able to get all the actions (View, Edit, Quick Edit, Trash), and not able to delete post in custom post type
- Automatically assign posts with custom field to taxonomy term
- Error [Column ‘post_title’ cannot be null] when title is disabled for Custom post type
- How to sort custom post’s category by id from the theme’s function.php?
- Change Background Color For CPT Template
- How can I make my CPT read from page-*post-type*.php?
- Permalinks for a custom post type – with a page template (custom query) and taxonomy archive
- How to add New Post On clicking a button?
- How to handle single entries of a custom post type?
- How to add base permalink to custom posts?
- Both parent and child articles in archive page
- Shortcodes in custom post fields without the_content()
- Query posts by a type and another type only if post is in specific category
- Search page for custom post type
- Rewrite rules causing hole
- Advanced Custom Fields: query posts filtered by multiple field values
- How can I sort posts ascending by post title for a specific post type, but on a category archive template?
- Save number of Facebook likes to database
- Add HTML before a specific div?
- Front end post or photo or both
- Is there any way of not using my_init_method in the following code (that creates a custom post type)?
- Display ONLY ONE $term (Out of 4 terms) from a Custom Taxonomy and CPT
- Adding a custom field after post title (ex.Example Title [30 Second Read])
- Is there a function that replace category name with a icon?