Group listed elements by category

I'm quite new to wordpress so there's a lot of terms I'm missing... I'd like to have a list of elements, grouped depending on a category.

For example, let's say I have a list of superhero movie names, I want the user to be able to group them either by hero or by franchise. It would look like this:

grouped by hero:

Iron Man
-Iron Man 1
-Iron Man 2
-Iron Man 3

Thor
- Thor 1
- Thor 2

Grouped by franchise:

MCU
- Iron Man 1
- Thor 1 ...

DCEU
- Batman 1
- Superman 1 ...

I have no idea if there are plugins or controls to help with this, don't know even how to look for the terms. The solution I was thinking of was to somehow assign to each movie a series of metadata tags, e.g.: to Iron Man 1 give it "hero:ironman", "franchise:mcu", "starring:rdjunior". And then pull from there, but it sounds quite convoluted...

Thanks in advance!

Topic plugin-list-category-post categories Wordpress

Category Web


The term you are looking for seems to be "Taxonomy", category and post_tag are base taxonomies, but you can register more taxonomies, depending on the needs.

Right now, you are in need of 2 taxonomies, "hero" and "franchise", once registered, you can affect them to a range of post_type.

I don't know if your "movie" is a CPT (Custom Post Type), but it should probably be.

(Edit) Forgot to give you some link in the Codex: https://codex.wordpress.org/Function_Reference/register_taxonomy

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.