
If you’re using a Theme Builder template for your single posts, then you’re using the ‘post content’ module to grab the content of your posts, and display and style it as defined in that Theme Builder template.
Great! This is why we love the Theme Builder. But…
What if you want to add a module inside that content, like a call to action? Not before or after, but inside the content, where it’s actually relevant to whatever the post is talking about?
Technically you can’t. All your post content is displayed within the dynamic post content module.
You can of course, switch to using the Divi builder on your posts instead of a Theme Builder template, but that defeats the object. Plus, let’s say you’ve got 50 existing posts. Editing everyone of those to use the Divi builder ‘on page’ is a pain in the arse.
But there is a solution. You’re going to have to do a little work if you already have a load of posts, but it’s a whole lot less work and you don’t have to lose the beautiful Theme Builder template you worked so hard on.
I’m writing this post in the classic WordPress editor, and a Theme Builder template using a post content module is displaying that content.
But what’s this? ?
Coming Soon
Madison Child Theme
for coaches & entrepreneurs
☝️ That’s not part of the post. That’s a row I created and saved as a library item. Check my other posts, they use the same Theme Builder template but you won’t see this row, because I didn’t add it to those posts.
I added it using a simple shortcode. Now if I want to keep that CTA in the post, but change the content, I just edit my library item, and the content changes to whatever I want. If I want to add it to another post, I just open the post up, pick where I want it to show, and include the shortcode.
Yes, of course I’m going to show you how ?
Use a child theme.
We need to add a PHP function to create the shortcode that we can then use to define which library layout to show in our post content.
Here is the code you need to copy and paste into your child theme functions.php file.
function showlibraryitem_shortcode($moduleid) {
extract(shortcode_atts(array('id' =>'*'),$moduleid));
return do_shortcode('[et_pb_section global_module="'.$id.'"][/et_pb_section]');
}
add_shortcode('showlibraryitem', 'showlibraryitem_shortcode');
‘showlibraryitem’ is how we will call this function in the post content.
Once you’ve added that code to your child theme functions PHP file, create whatever section, row, or module you want to display inside your post content and save it to your Divi Library. Then grab the ID for that layout and make a note of it.
How? Just hover over the library layout and check the post ID that appears at the bottom of your browser window. You also see this number (red box) in the address bar if you’re editing the layout inside the library.

Adding the shortcode.
Now open up the post you want to add your library layout to, and in the text editor enter your shortcode with the ID of the library layout you just created.
[showlibraryitem id="12345"]
Here it is again ?
Coming Soon
Madison Child Theme
for coaches & entrepreneurs
Publish your post, and voilà!
That’s it, all done!
Michelle x