Below, you’ll find a detailed guide on how to add the Supreme Modules For Divi Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Supreme Modules For Divi Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the Supreme Modules For Divi Plugin and the shortcodes it provides:
"Supreme Modules Lite is a versatile plugin for Divi Theme, Extra Theme, and Divi Builder. It enhances your WordPress experience by adding new design possibilities and features to your themes."
- [DSM_SHORTCODE]
Supreme Modules For Divi [DSM_SHORTCODE] Shortcode
The DSM_SHORTCODE is a powerful tool within the supreme-modules-for-divi plugin. It enables the execution of a specific Divi module globally, using its unique ID. Upon calling, it checks if the ‘id’ attribute is present in the shortcode. If not, it returns an empty string. If present, it executes the Divi section associated with the ‘id’, making it a versatile tool for site customization.
Shortcode: [DSM_SHORTCODE]
Parameters
Here is a list of all possible DSM_SHORTCODE shortcode parameters and attributes:
id
– A unique identifier for the specific Divi section
Examples and Usage
Basic example – A simple usage of the DSM_SHORTCODE to display a specific Divi section by its ID.
[dsm id=1 /]
Advanced examples
Using the DSM_SHORTCODE to display multiple Divi sections by their IDs. This can be useful when you want to display a series of sections in a specific order.
[dsm id=1 /]
[dsm id=2 /]
[dsm id=3 /]
Using the DSM_SHORTCODE to display a Divi section within a post or page content. This can be useful when you want to include a reusable section in multiple places across your site.
[dsm id=1 /]
Your regular post or page content goes here.
[dsm id=2 /]
Please note that in these examples, you should replace ‘1’, ‘2’, ‘3’ with the actual IDs of the Divi sections you want to display.
PHP Function Code
In case you have difficulties debugging what causing issues with [DSM_SHORTCODE]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( DSM_SHORTCODE, array( $this, 'dsm_divi_shortcode' ) );
Shortcode PHP function:
function dsm_divi_shortcode( $divi_shortcode = array() ) {
if ( empty( $divi_shortcode['id'] ) ) {
return '';
}
return do_shortcode( '[et_pb_section global_module="' . $divi_shortcode['id'] . '"][/et_pb_section]' );
}
Code file location:
supreme-modules-for-divi/supreme-modules-for-divi/includes/class-dsm-supreme-modules-for-divi.php
Conclusion
Now that you’ve learned how to embed the Supreme Modules For Divi Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.
Leave a Reply