Bdthemes Element Pack Lite Shortcode

Below, you’ll find a detailed guide on how to add the Bdthemes Element Pack Lite 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 Bdthemes Element Pack Lite Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Bdthemes Element Pack Lite Plugin and the shortcodes it provides:

Plugin Icon
Element Pack Elementor Addons (Header Footer, Free Template Library, Grid, Carousel, Table, Parallax Animation, Register Form, Twitter Grid)

"Element Pack Elementor Addons is a versatile plugin offering header/footer options, a free template library, grid, carousel, table, parallax animation, registration form, and Twitter grid functionalities."

★★★★☆ (149) Active Installs: 90000+ Tested with: 6.3.2 PHP Version: 7.4.0
Included Shortcodes:
  • [rooten_custom_template]

Bdthemes Element Pack Lite [rooten_custom_template] Shortcode

The rooten_custom_template shortcode is a feature of the bdthemes-element-pack-lite plugin. It allows you to display content created with Elementor on your WordPress site. This shortcode retrieves and displays a specific Elementor template based on its ID. If the ID is not specified or invalid, it returns an empty string.

Shortcode: [rooten_custom_template]

Parameters

Here is a list of all possible rooten_custom_template shortcode parameters and attributes:

  • id – A unique number that identifies the specific template

Examples and Usage

Basic example – A simple shortcode to display a custom template by referencing its ID.

[rooten_custom_template id=1 /]

Advanced examples

Example 1 – Using the shortcode with an invalid ID. In this case, the shortcode will return an empty string because the ID does not exist.

[rooten_custom_template id=9999 /]

Example 2 – Using the shortcode without any ID. Similar to the previous example, this will also return an empty string because no ID is provided.

[rooten_custom_template /]

Please note that the ‘rooten_custom_template’ shortcode has been designed to work with only one attribute, ‘id’. Adding more attributes will not have any effect on its functionality. Always ensure that the ID you provide corresponds to a valid custom template for the shortcode to work as expected.

PHP Function Code

In case you have difficulties debugging what causing issues with [rooten_custom_template] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('rooten_custom_template', array($this, 'shortcode_template'));

Shortcode PHP function:

function shortcode_template($atts) {

        $atts = shortcode_atts(
            array(
                'id' => '',
            ),
            $atts,
            'rooten_custom_template'
        );

        $id = !empty($atts['id']) ? intval($atts['id']) : '';

        if ( empty($id) ) {
            return '';
        }

        // if (class_exists('\Elementor\Post_CSS_File')) {

        // 	// Load elementor styles.
        // 	$css_file = new \Elementor\Post_CSS_File($id);
        // 	$css_file->enqueue();
        // }

        return self::$elementor_instance->frontend->get_builder_content_for_display($id);
    }

Code file location:

bdthemes-element-pack-lite/bdthemes-element-pack-lite/includes/class-rooten-theme-compatibility.php

Conclusion

Now that you’ve learned how to embed the Bdthemes Element Pack Lite 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.

Comments

Leave a Reply

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