Home › Forums › General Issues › populate divi gallery module with ACF › Reply To: populate divi gallery module with ACF
Hi my friend @kreatibu,
I wil tell you how to accomplish this,is not so difficoult:
first of all you need an update divi environment with your custom child theme enabled and obviously the latest ACF plugin installed.
Then you have to create your ACF gallery field(let’s suppose to name it divi_acf_gallery).
now you have to create your custom divi module that will automatically populate the images from the divi_acf_gallery field.
Create in your child theme a file named “custom-acf-gallery-module.php” and be sure to add the correct permission/owner/group if you have a local setup/VPS/private server, open it with your preferred editor like notepad++ and past exactly the entire content of the standard gallery module(you can find this in /wp-content/themes/Divi/include/builder/module/Gallery.php
Now you have to customize the module with your ACF field, this can be done in 3 steps:
FIRST STEP
on top of the file you have this code
<?php
class ET_Builder_Module_Gallery extends ET_Builder_Module {
simply edit as follow to begin your own custom function that we then enqueue to our functions
<?php
function ex_divi_child_theme_setup() {
if ( class_exists('ET_Builder_Module')) {
class ET_Builder_Module_Gallery_ACF extends ET_Builder_Module {
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.