Create shortcodes for any Divi page builder element



Here’s a handy tip if you are using Divi WordPress theme.

You can use this free plugin to create shortcodes for any Divi page builder element. This will come handy if you want to display Divi page builder layouts almost any place in the site you want. Ex: Widgets, WooCommerce pages,..

You can even call shortcode in child theme template file using do_shortcode function to display layouts site wide.

Try it now in our demo platform: http://demo.diywithwp.com/

Please note, you need to enable custom post type support in order to use Divi builder on shortcode creator pages (In our demo platform you can enable Divi booster plugin and activate this feature).

https://wordpress.org/plugins/shortcode-maker/

Use these shortcodes in floating sidebar with this plugin: https://wordpress.org/plugins/wp-contact-slider/

…..

do_shortcode Function

Say, you want to show shortcode on certain pages, add this code to the template where you want to show the shortcode.

<?php
global $post;

$list_of_id = array( 9, 10, 11, 13, 67, 8, 12, 63, 65 );
$current_page_id = $post->ID;

if ( in_array( $current_page_id, $list_of_id) ) {
do_action('shortcode');
}
?>

ID = Page ID

To exclude shortcode on certain pages, use this:

<?php
global $post;

$list_of_id = array( 9, 10, 11, 13, 67, 8, 12, 63, 65 );
$current_page_id = $post->ID;

if ( !in_array( $current_page_id, $list_of_id) ) {
do_action('shortcode');
}
?>

ID = Page ID


Source https://wordpress.org/plugins/shortcode-maker/

Tuts Directory Rating

1




  • The comment section is for blog post/tutorial rating and reviewing purposes only. If you have any questions about a tutorial, please post them in the tutorial publisher's website.

    Leave a Reply

    Be the First to Comment!

    Notify of
    avatar
    wpDiscuz