How to Build a Custom Post Type Portfolio Gallery in Divi 5

Follow one studio's portfolio from empty page to a filterable gallery that updates itself, with no code.

Filterable Divi 5 portfolio gallery with category pills and project titles built from a custom post type

To build a Divi portfolio gallery from a custom post type, add HappyDivi Gallery, set Content Source to Custom Post Type, pick your post type, then turn on the filter bar and link each image to its project page. New projects then appear on their own.

Imagine a small design studio with 40 projects. Each new project currently means editing the portfolio page by hand, and when a prospect asks "do you do branding?", the owner sends a link to everything. Let us fix both problems, step by step.

Every screenshot comes from a real test site running Divi 5.15.1 and HappyDivi Gallery 1.0.25.

Why Not Use Divi's Own Modules?

Divi has good options, and they may be enough for you:

  • Filterable Portfolio is great if your work lives in Divi's Projects post type.
  • The Loop Builder in Divi 5 can repeat modules from any post type if you are happy to build the card and layout yourself.

HappyDivi Gallery is for when you want one module that handles any post type with the filter bar, shareable filter links, Load More and a choice of layouts already built.

Step 1: Put Your Projects in a Post Type

You have two choices. Use Divi's Projects, which already has categories, or register your own post type, such as Case Studies, with Advanced Custom Fields or Custom Post Type UI.

Whichever you pick, each project needs a featured image for the gallery and a category for the filter bar.

Step 2: Add the Gallery and Pick Your Post Type

In the Visual Builder, add a HappyDivi Gallery module. Under Image / Content Source:

  1. Set Content Source to Custom Post Type (featured images).
  2. Choose your Post Type. Our demo uses Project.
  3. Set Order By to Publish Date and Order Direction to Descending, so new work comes first.
HappyDivi Gallery Content Source set to Custom Post Type and Project beside the resulting portfolio grid

Pick the post type, and the preview fills with your real projects.

Want your best work first?

Order By offers Publish Date, Title and Random. To feature a project, adjust its publish date, or build a second gallery limited to a "Featured" category.

Open Caption, turn on Show Title and set Content Position to Below Image. Then open Click Action and set Image Click Action to Go to Post / Product URL.

HappyDivi Gallery Caption settings with Show Title on and Content Position Below Image beside project cards

Titles below the image read clearly on any photo.

This is what answers "do you do branding?". Under Filter Bar:

  1. Turn on Enable Category Filter.
  2. Choose a Filter Bar Style: Pills, Tabs, Buttons or Dropdown.
  3. Turn on Save Filter in URL.

Now, when someone clicks Branding, the address changes to something like ?hdg_cat=branding. Anyone who opens that link lands on the portfolio with Branding already selected.

Filter Bar settings with Save Filter in URL on, beside a portfolio filtered to Branding with hdg_cat=branding in the address bar

Our test: clicking Branding showed 3 of 9 projects and updated the URL.

Step 5: Add Load More

Forty projects should not load at once. Under Pagination, turn on Enable Pagination, set Pagination Type to Load More Button, Images Per Page to 12, and change Load More Button Text to something friendly, such as "See More Work". A button keeps your contact section easy to reach. Not sure? Read our gallery pagination guide.

The Finished Settings

GroupSettingValue
Image / Content SourceContent SourceCustom Post Type
Gallery LayoutLayout, Aspect RatioGrid, Landscape (4:3)
CaptionShow Title, Content PositionOn, Below Image
Filter BarStyle, Save Filter in URLPills, On
PaginationType, Images Per PageLoad More, 12
Click ActionImage Click ActionGo to Post / Product URL

If Something Looks Wrong

Check that your items are published and have featured images, and clear Included Categories to test.

A Project Never Shows Under Its Filter

The project has no category assigned. Edit it and tick one.

Turn on Save Filter in URL, then copy the link from the address bar after clicking the filter, rather than typing it.

Frequently asked questions

Can I build a filterable portfolio in Divi 5 without code?

Yes. With HappyDivi Gallery, you pick your post type and turn on the filter bar in the Visual Builder. There is no code, shortcode or template file to edit.

Can I use Divi's own Projects post type?

Yes. Choose Project under the Custom Post Type source and keep adding work the way you already do.

Do new projects appear automatically?

Yes. The gallery reads your post type when the page loads, so a newly published item with a featured image appears without editing the page. If you use page caching, clear it to see the change straight away.

Should a portfolio use Grid or Masonry?

Use Grid when each project should carry equal weight, which suits most agencies. Use Masonry when images vary in shape and cropping would hurt the work.

Want the full picture? The Complete Divi 5 Gallery Guide covers every source, layout, lightbox, filter and pagination option.

Get the next Divi 5 guide

New guides and plugin news from HappyDivi. Unsubscribe any time.

Rubait Hasan

Written by

Founder & Product Builder

Rubait has been building for Divi since 2017. He founded DiviZoom in 2019, sold it in 2022, and started HappyDivi when Divi 5 rebuilt the builder from the ground up. He writes the code behind HappyDivi's plugins and answers support himself.

More articles by Rubait

Get the next Divi 5 guide

New guides and plugin news from HappyDivi. Unsubscribe any time.