Deprecated: Creation of dynamic property SureCart\Licensing\Updater::$cache_key is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/pac-wp-inbox/inc/licensing-sdk/Updater.php on line 22

Deprecated: Creation of dynamic property SureCart\Licensing\Updater::$cache_key is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/pac-wp-inbox/inc/licensing-sdk/Updater.php on line 22

Deprecated: Creation of dynamic property SureCart\Licensing\Updater::$cache_key is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/pac-wp-inbox/inc/licensing-sdk/Updater.php on line 22

Deprecated: Creation of dynamic property SureCart\Licensing\Updater::$cache_key is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/pac-wp-inbox/inc/licensing-sdk/Updater.php on line 22

Deprecated: Creation of dynamic property SureCart\Licensing\Updater::$cache_key is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/pac-wp-inbox/inc/licensing-sdk/Updater.php on line 22

Deprecated: Creation of dynamic property SureCart\Licensing\Updater::$cache_key is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/pac-wp-inbox/inc/licensing-sdk/Updater.php on line 22

Deprecated: Creation of dynamic property SureCart\Licensing\Updater::$cache_key is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/pac-wp-inbox/inc/licensing-sdk/Updater.php on line 22

Deprecated: Creation of dynamic property WOO_SL_functions::$query_vars is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/woocommerce-software-license/include/class.sl.functions.php on line 35

Deprecated: Creation of dynamic property WOO_SL::$licence is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/woocommerce-software-license/include/class.sl.php on line 21

Deprecated: Creation of dynamic property WOO_SL_functions::$query_vars is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/woocommerce-software-license/include/class.sl.functions.php on line 35

Deprecated: Return type of GeoIp2\Model\AbstractModel::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/termageddon-usercentrics/vendor/geoip2/geoip2/src/Model/AbstractModel.php on line 63

Deprecated: Return type of GeoIp2\Record\AbstractRecord::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/termageddon-usercentrics/vendor/geoip2/geoip2/src/Record/AbstractRecord.php on line 57

Deprecated: Automatic conversion of false to array is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/divi-social-sharing-buttons/includes/modules/SharingButton/SharingButton.php on line 115

Deprecated: Creation of dynamic property DMB_Module_Code_Snippet::$icon is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/themes/Divi/includes/builder/class-et-builder-element.php on line 1403

Deprecated: Creation of dynamic property DMB_Module_Code_Snippet::$whitelisted_fields is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/themes/Divi/includes/builder/class-et-builder-element.php on line 1403

Deprecated: Creation of dynamic property DMB_Module_Code_Snippet::$fields_defaults is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/themes/Divi/includes/builder/class-et-builder-element.php on line 1403
How To Add Shortcodes In Divi - Pee-Aye Creative

Deprecated: Creation of dynamic property ET_Builder_Module_Comments::$et_pb_unique_comments_module_class is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/themes/Divi/includes/builder/class-et-builder-element.php on line 1403
î‚£

Subscribe On YouTube

Join other subscribers and enjoy other Divi video tutorials!

How To Add Shortcodes In Divi

Nelson Miller Profile Orange
Learn how to add shortcodes from any plugin in the Divi Builder and place the shortcode a Divi module anywhere in your layout.

Add Shortcode In A Text Module

The Best Method For Adding Shortcodes In Divi

The best method we can use to add a shortcode anywhere in our Divi layout is to use the Text module. If this surprises you, just remember that the text module is bascially an HTML module. When you switch from the Visual tab to the Text tab within the Text module, you can seee the HTML markup.

To add your shortocode, just go to whichever WordPress plugin you have installed that generates the shortcode and copy it. Then go to your Divi Visual Builder and add a Text module. Paste the shortcode there, and your shortcode will render the design of the WordPress plugin features.

Styling The Shortcode

Depending on what the shortcode does or how it is made, you may be able to style certain parts of it using the Divi Builder. For example, if there are any headings or paragraph text elements, you  can use the settings in the Design tab to style those. All of these extra feature are why I rececommend using the Text module as apposed to the Code module.

Add Shortcode In Code Module

Alternative method For Adding Shortcodes In Divi

Another very limited method we can use to add a shortcode anywhere in our Divi layout is to use the Code module. I don’t know why you would want ot use this, but I’ve seen people who do, so here it is.

To use this module, just copy the shortcode from the WordPress plugin you are using that generated the shortcode. Then go to your Divi Visual Builder and add a Code module. Paste the shortcode there, and your shortcode will render the design of the WordPress plugin features.

Categories: Divi FAQ Tutorials

Subscribe For More Things Like This!

At the start of each month, we send out a recap newsletter from the month before with family news, Divi news, our latest tutorials, and product news. Occasionally, if the news is too exciting to wait, we will send out another email separate from the monthly newsletter. That’s what you get when you subscribe, and of course you can unsubscribe if you are no longer interested!

Blog Post Optin
Divi Logo (2)

Shop Our Divi Products

Plugins • Courses • Templates

Visit The Shop

Featured Products

î‚£

Divi Tutorials On YouTube

Our videos have views! Join subscribers and enjoy over video tutorials!

Visit Our Channel

Leave A Response!

By commenting you agree to our Blog & YouTube Comments Policy

21 Comments

  1. Vyshnav

    When i add a textbox and button using shortcode(written in functions.php) it always shows at the top of website, In divi visual builder it was placed at bottom, but regardless where it placed on visual builder on front-end it display on the top.

    Reply
  2. Dom

    Hi Nelson,

    How do you add a shortcode to a button module URL field? I have been using a work around by using a text module – styling the text to look like a button – but would prefer to use the button module.

    Thanks

    Reply
      • Dom

        As an example I recently helped a friend with his site which uses the GloriaFood.com food menu system. They give you the option to use a button they have created to show a pop-up food / takeway menu. As their button was very different from the divi buttons he has on his site, and their styler is very basic, I tried to add the shortcode they provide to a divi button URL field (also removing their class glf-btn-basic)

        [restaurant-menu-and-ordering class=”glf-btn-basic” ruid=”xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”]

        It did not work so I had to create a button using a text module, using the shortcode as the URL, and it worked fine. My question is, is their anyway to add shortcodes like this to the divi button module URL field. It obviously calls up a javascript popup menu and then populates it with the menu items via the ruid number.

        https://www.gloriafood.com/restaurant-ideas/add-online-ordering-button-wordpress

  3. Steve

    Thanks for the tutorial.

    I created a template in the theme builder for a product. I do not want to use the standard Woo Tabs as they are inadequate. There’s a tab plugin that generates a shortcode that I’d like to use for each product and it be unique for each product. The goal was to be able to do it dynamically.

    I have tried with ACF creating a custom field in almost every format (ie Text, text area wziswyg etc) for the field and added the shortcode to that field.

    I the theme template page I added a text module and added the dynamic field (shortcode) I created for the product, but no matter what I do, it doesn’t show up. Depending on the format of the field, it will show up as a bunch of commands, but not the Tabs from the shortcode. If I add a code module with the shortcode, the tabs show up.

    Is there a way to have the shortcode showu p dynamically on a Divi theme product page?

    Thanks for you wisdom in advance.

    Steve

    Reply
    • Hemant Gaba

      Hi Steve

      The approach of using a Custom Field to provide information is correct but as you are using a tab plugin to generate a shortcode so I guess it will not take into account the information present in the Custom field and will show the general result. To achieve the results you need to write the Custom PHP code to show the tabs. In that code, you need to manipulate the value of the Custom field in such a way that it should change the content inside the tab with the change in the information of the Custom Field. After that, you need to put that code in the function to create a shortcode and then use this shortcode inside the Code Module to showcase the results on the frontend.

      Let us know if that helps.

      Reply
  4. Aimi

    Thanks for the guide! Is it possible to add more than one shortcode to a single module?

    Reply
  5. Steve McDonnell

    I used a Code block instead of a Text block because I am passing several string parameters to the shortcode that made it span multiple lines. Even though it was all one line with no line feeds, Divi was adding some HTML to some of the parameters (e.g., “”). When I used a Code block instead, I didn’t have that problem and it worked perfectly.

    Reply
  6. Alison

    I used this to add a subscribe via paypal button and it all works fine on the laptop but not on the mobile version – any ideas why?

    Reply
  7. Steve

    I’m using the plugin Ultimate Member which uses shortcodes in order to restrict content to logged in users. In order to restrict content within a page they say to “wrap the content” in the shortcode. For example:

    [um_loggedin show_lock=yes] This text can only be seen by logged in users [/um_loggedin]

    How would I wrap an entire page SECTION in this code?

    Reply
    • Nelson Lee Miller (aka The Divi Teacher) <span class="comment-author-role-label"><a href="https://www.peeayecreative.com/product/divi-adventure-club/" class="comment-author-role-link" rel="external nofollow" target="_blank">Divi Adventure Club Member</a></span>

      It sounds like they are asking about the content within a page or post rather than the entire page. They probably would have some other means of restricting the entire page, but you would need to ask them, this tutorial is more just about showing how to add shortcodes in Divi.

      Reply
  8. John

    Hi Nelson…. Is it possible to add a shortcode to a section background in Divi? Rather than an image, video, etc.? I have a mapping plugin that uses shortcodes, and I would like to use a map as a background with some text and an image over it.

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Recent Posts

0

Your Cart