What you want to do is to group fruits by color. In WordPress term appropriate mechanism for that is taxonomy (categories and tags are examples of taxonomy).
I would create a custom taxonomy “fruit color” where terms would be individual colors and assigned to fruits.
Then your display logic would be to:
- retrieve all fruit colors terms
- for each term display its title and posts that have the term assigned
You could do this with tags (since tags are taxonomy), but it works cleaner when taxonomies have specific purpose and don’t mean different things in different contexts (as in your tag would mean “color” for fruits, but something entirely different for non-fruits).
Related Posts:
- Category archive page – loop through posts of certain tag (with pagination) – pre_get_posts
- Is there a reason I cannot get the current category in a loop?
- Editing Loop So It Targets Specific Tags?
- Display all categories but only if they have posts in them that have a specific tag assigned
- How to prevent tag “iframe” from being deleted from the heading description of rubric?
- How to add an empty entry to masonry?
- Get the children of the parent category
- Control term order on a per-post basis
- How do I get the category URL from get_the_category?
- Rewrite URL with category and tag combined using WP_Rewrite
- Default WP Gallery – show only galleries of a certain category
- How to tax query X number of posts related by tag first, then by category if not enough in tag-related
- Display all posts in category, with specific tag posts at top
- Are Categories, Tags and Custom Taxonomies any different in regards to SEO?
- Display list of Sub-Categories and the posts they contain, within one main Category
- Create subdomains for tags and categories
- Automated adding of one tag to all the posts in a category
- Moving Categories submenu to Media, but still opens Posts menu
- When using get_categories or similar, is it possible to filter results that contain certain Tags as well?
- How to totally get rid of Category in my blog?
- Category Descriptions – HTML?
- Deleting All tags except categories Wp database
- Search by word, category, tag, author
- How to filter archives both by category and tag?
- display most popular tags of category?
- Exclude category from loop not working
- Custom WP_Query for current category (in category.php)?
- If newest post of category is newest post in general, skip first post of category
- Why would in_category only return one post in a specific category?
- Are Category or Tag Archive Pages Possible?
- Random post + categories + tags
- Search Posts / Pages with multiple options?
- RSS/XML of all Categories and/or Tags
- Second level subcategory
- how to define category loop last class in the third
- Get Tags specific to Category using WooCommerce plugin
- Custom Tag Description unable to display just below and outside of the Loop
- How to get related tags based on a category?
- Needing a snippet for listing category specific tags
- How to list categories within tags?
- Multiple Loops on category.php with pagination on last loop
- Use Tag input metabox style for Categories
- Custom SQL Query: Get all posts with category id and a concated list of tags on each post
- limit a list of tags to one category [closed]
- Have multiple category queries from the URL been fixed yet?
- Display single category name in woocommerce loop
- Show Posts from Single Category Not Working
- Pagination on category.php and tag.php not working
- Problem with different query loops (and “main loop”) on category template page!
- How to do paging in the loop?
- How to loop custom post_type from (a) specific category(ies)?
- Show the amount of posts in a tag in a specific category has
- Display all product tags associated with a specific product category
- How replace individual elements in the RSS feed with a single string
- Display posts of certain categories to specific user roles
- Adding a H1 Tag to Post Tags automatically, but hide the tag? (Same for Category)
- Conditional category & tag statement
- Problem with multiple loops in wordpress theme
- multiple values in an array for category__and does not work with WP_Query
- How can I filter posts by tag on the fly
- List post only under the category, exclude child category content
- Filter categories/tags to display in multiple metaboxes for selection in back-end
- How can I include custom category and tag base in template files?
- Autolinking keywords in text with tags
- Maintaining a separate posts page for certain categories and don’t show those on home page
- Are tags different than categories?
- How to get posts using category slug in ClassiPress?
- Custom menu with categories and tags
- Exclude posts without category from loop
- Show Posts via cat+cat in URL that are in both Categories doesn’t work
- Help to display the current categories and tags of a post
- How to hide description on categories and tags?
- Hide specific category tag on single post page
- Filtering posts in category by tag URL
- echo $category[0]-> cat_name; shows only one category name
- When creating category, it creates automatically tag, or, when creating tag, it creates automatically category in same name
- Loop by category and meta_key
- Assign a class to first element in category in loop
- Category and tag urls return 404 error
- How to echo Tags and Categories as plain text
- Hide category name using mod_rewrite
- Category page shows only 1 post when that post has more than 1 category?
- Configure query with multiple categories in a custom order?
- How to exclude category and post_tag taxonomy while displaying custom taxonomy?
- 404 error when i try to search by category or by tag
- How can I modify this code to iterate over an array of categories?
- Loop within category’s posts
- How to remove specific categories from tag archives?
- Display one post on category.php: Wrong featured image
- Display related posts with same category or same tag return blank
- WordPress Numeric Pagination with Query String [duplicate]
- Several loop in search result
- How to create a category or tag available exclusively to the admins and not to the users?
- Printing direct descendants of a category with WP_Query
- Detecting top parent category fails on home page
- List products from current category
- How do I hide posts in a category from all listings but still allow the posts to be viewed?
- How can I implement pagination on custom category page?
- Order Categories by Character Count
- In my wordpress admin panel Suddenly The Category, tag and featured Image Option are not showing