** UPDATE 25/07/2019 **
I had several requests to update this code so it worked with later versions of Divi. That’s now been done and tested on version 3.26.3. I’ve also simplified the process so you simply download the custom file now instead of copying a load of code.
Elegant Themes could change the original Filterable Portfolio code at any point and cause this custom code to break. If you upgrade and notice any issues, please let me know and I’ll update the code again.
If you’re running a significantly older version, you can download and try my old version of the code here.
If the old or new versions of my code don’t work for you and you are desperate to sort it, email me and attach the following file:
/wp-content/themes/Divi/includes/builder/module/FilterablePortfolio.php
When I get time, I can then create a version that will work.
Divi is an awesome theme, but the way some of the modules work doesn’t always fit with what you want to do on your website.
One issue I’ve had in the past is the way the Filterable Portfolio module works. By default, the project items listed by the module automatically link back to the main project page.
So what happens if you want to change these links to take you somewhere else like a product in your shop, or another page on your site?
The filterable grid is built using some core PHP in the Divi theme and it’s extremely difficult finding out how to override this, but don’t worry, I’ll show you how 🙂
In this tutorial we’ll be creating a customised version of the Divi Filterable Portfolio module that lets you add custom fields to your project entries as follows:
1) url: Sets the url you want to open when the project item is clicked in the grid
2) target: Sets the url target (e.g. ‘_self’ or ‘_blank’), allowing you to redirect the link to a new browser tab if you want
The changes we are making are written in a safe manner, so if you do NOT set either of the custom fields above the grid will still work as normal.
DISCLAIMER
The code is tested on Divi version 3.26.2. It may not work correctly on older versions and also newer versions, if Divi change the code for the module again.
If the functionality doesn’t work for you, send me an email and include your specific FilterablePortfolio.php file from your version of Divi. You can find it in this folder:
/wp-content/themes/Divi/includes/builder/module
When I get chance, I’ll create a custom file that works with your version of Divi and send it back to you 🙂
PRE-REQUISITES
To implement this, it’s essential that you are using a CHILD THEME as we will need to create a copy of one of the Divi core PHP files. If you’re not using a child theme, it’s easy to do.
Here’s our article explaining how to create a Divi Child Theme
You will also need file-level (or FTP) access to your web server to create/upload some files.
DEMO
I’ve created a quick demo showing three project items listed in a filterable portfolio:
View the Demo
Each has a custom URL it links to. The first item opens the DiviHype Blog in the same tab, the 2nd opens our custom modules page in a new window and the 3rd opens the Elegant Themese website in a new tab.
HOW TO IMPLEMENT THE CODE
1) Create a new subfolder
Under your child theme folder, create a new subfolder named custom-modules.
2) Create the custom PHP file
Download this zip file, unzip it and upload the FilterablePortfolio.php file inside to your new custom-modules folder
3) Add Code to your functions.php file
Paste the code below into your child theme functions.php file. This code tells wordpress to ignore the standard Filterable Portfolio and use our custom version instead:
// Replace the existing filterable portfolio with our customised version
function divi_custom_filterable_portfolio_setup() {
if ( ! class_exists('ET_Builder_Module_Type_PostBased') ) {
return;
}
get_template_part( 'custom-modules/FilterablePortfolio' );
$cfwpm = new Custom_ET_Builder_Module_Filterable_Portfolio();
remove_shortcode( 'et_pb_filterable_portfolio' );
add_shortcode( 'et_pb_filterable_portfolio', array($cfwpm, '_shortcode_callback') );
}
add_action( 'wp', 'divi_custom_filterable_portfolio_setup', 9999 );
HOW TO SET THE CUSTOM LINKS
- To set a URL for a Project: Add a custom field called url and set the value to the url you want
- To make the link open in a new window: Add a second custom field called target and set the value to _blank
Note: The target will be ‘_self’ by default, so if you don’t add the target custom field, the URL will open in the same window.
An example of these two custom fields added for a Project is shown below:

Rounding Up
Wow! You’ve customised one of the Divi modules, how awesome is that? You’re new Divi Filterable Portfolio grid will work exactly as before, but you can now add custom fields to redirect entries to any URL you want!
If you found this tutorial useful, leave a comment!
About the Author
![]()
Ed Solman
Entrepreneur, Blogger and Website Developer/Designer. Passionate about helping people and businesses develop and grow. Daredevil sportsbike enthusiast.

Hi I am getting error:
You’re Doing It Wrong! Custom_ET_Builder_Module_Filterable_Portfolio::_shortcode_callback() is deprecated. Use Custom_ET_Builder_Module_Filterable_Portfolio::_render() instead.
Using _render() breaks the whole thing.
Hi Theresa, sorry you’re having trouble. This worked perfectly when I first set it up. It’s still working OK on my Divihype site. Perhaps your version of Divi is not up to date? I’d be happy to help if you can send me some more information or a link to the website you’re having trouble with. Feel free to email me or contact me via the DiviHype Facebook page. Thanks, Ed
Thanks for the great instruction! It was exactly what i needed…
But now i have the problem that the filterable portfolio is no longer shown in the visual builder. Is there a solution for that?
HI Simon, I’m not sure what the issue is. It might be a problem after a Divi update. It’s possible they have updated something that means the code I posted now clashes, or it may just be a bug. I’d be happy to help if you can send a link I can look at for you. Thanks, Ed
It seems that I am not seeing the Custom Fields Section on the project. Really hoping I can get this to work. Thank you.
Hi Mike, if you’re not seeing Custom fields when viewing a page in the admin area, click on ‘screen options’ (top right) then tick the ‘Custom fields’ option. Hope that helps 🙂
Thank you, thank you, thank you for this fix!!! It was such a big help getting the permalink to behave the way I needed it to on a portfolio page.
You’re welcome, glad it was useful for you.
Ed …. Great work. I’v been searching two days for this and you have delivered.
Thank you so much for this! Strangely, when I unzipped the file, it gave me a file with a “2” at the end, but the custom functions.php code references FilterablePortfolio.php. So I simply renamed the file on my server in its directory and it works perfectly now.
ps – I’m running Divi 3.27.4
I’m not sure why that happened Steven. I’ve checked the zip files and they only contain one file named FilterablePortfolio.php in them. Maybe you had previously downloaded it, in which case your operating system might have added an extra ‘2’ on the end so the filename would be different?
Thank you very much. This is exactly what I was finding for a few days on the search engine. Thanks. It works perfectly on my Divi Version: 3.29.3
You’re welcome 🙂
Hello ! Thx for this tutorial. Just a question : Is it possible to do this just with the simple portfolio, not filterable ?
I’m sure it is, but would require additional code and an updated template file for the simple portfolio module. If I get chance I’ll look into it for you.
You, my friend, are a legend!
Hi Ed.
I have a couple questions:
1. Any idea if this is working with Divi 4 (or more specifically v4.3.2)?
2. Also, can you suggest a way to adjust the order of the projects in the filterable portfolio?
Thanks in advance for any help you might be able to offer.
Hello thanks for this tips!
We are on 4.4 DIVI version now, the code about FilterablePortfolio.php file is still working fine, but the code to place into function.php make site crash…
Do u have an idea why?
i tried some debug test, and find that this part make the crash :
get_template_part( ‘custom-modules/FilterablePortfolio’ );
$cfwpm = new Custom_ET_Builder_Module_Filterable_Portfolio();
Can you help me to resolve please?
Many thanks to you,
Jen
Worked perfectly!!! Thanks a Lot! I use the latest Divi version.
You’re most welcome, glad it was useful for you.
Hello Ed, I am getting this error message when the page loads in Divi Builder. Once it redo the portfolio it is fine until the next time I load the page. I am using Divi 4.4.5 and a child theme.
function(t){return r.a.createElement(f.a,E({rawContentProcesser:h.default.replaceCodeContentEntities},e.props))}
Thanks Ed
Hi Steve, I expect the filterable portfolio module has ben updated in the version you’re using and my code may no longer work. It does involve overriding the entire module template, so if ET make any significant changes to it, my overriden file may then cause issues. If I find time, I’ll try and update it again for the latest Divi release.
I successfully implemented your technique here – https://www.justthinkart.com/test/ (clicking on Zentangle #2 leads to Google). However, the pagination seems to have been gone. ET has acknowledged as a known bug. Can you code be modified in any way to make it work?
To be honest Asit, it may be that the module has changed since I wrote this article. It involves overriding the default Divi Filterable portfolio module code, so if they’ve updated it recently then my code now may not work as expected. If I find time, I will try to post an update.
Hi! Thank you very much for your tutorial. I use your code on my current project. The only thing I’m struggling with is the “open in new tab” option.
I added “target” and “_blank” in the custom fields section but the links still open in the same window.
Do you have an idea what the problem might be?
Sorry I’m not sure. This code is quite old now and it’s possible Divi have changed the module code on the version you’re using, so it may no longer work as expected. Other people seem to have used it successfully, so perhaps worth double-checking you’re followed the steps correctly?