This members-only tutorial provides the steps to use Meta Box to set up a HappyFiles category selector so that images from the selected categories will be shown as a gallery on Pages or Posts etc.
Categories in Media Libary:
![](https://wpdevdesign.com/wp-content/uploads/2021/12/happyfiles-gallery-1024x328.jpg)
Selecting one or more categories when editing a Post using Meta Box' Taxonomy Advanced field:
![](https://wpdevdesign.com/wp-content/uploads/2021/12/CleanShot-2021-12-24-at-12.33.41@2x-1024x156.png)
Post when viewed on the front end:
![](https://wpdevdesign.com/wp-content/uploads/2021/12/happyfiles-gallery-frontend-1024x799.jpg)
Clicking on an image in the gallery will open it in a lightbox with previous/next navigation, close button, optional thumbnail navigation within the lightbox etc.
Step 1
Installed and activate Meta Box and Meta Box AIO.
Go to Media > Library, create your desired categories and drag images into them.
Go to Meta Box > Custom Fields and create a new field group having Advanced Taxonomy type of field having a label of say, "HappyFiles Category".
![](https://wpdevdesign.com/wp-content/uploads/2021/12/CleanShot-2021-12-24-at-12.44.20@2x-1024x525.png)
In the Settings tab, select the post type you want the group to be attached to. Let's say post
post type in this example.
Step 2
Edit the Oxygen Template that applies to your post type, in this example, to all the single posts.
Add a Code Block component where you want to display the images from the selected category/categories for each post.
Set Width to 100%.
PHP & HTML:
This is a premium members-only content.
To view the rest of the content, please sign up for membership ($47/month or $599 one-time).
Already a member? Log in below or here.