Below, you’ll find a detailed guide on how to add the DethemeKit For Elementor Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the DethemeKit For Elementor Plugin shortcodes not to show or not to work correctly.
Before starting, here is an overview of the DethemeKit For Elementor Plugin and the shortcodes it provides:
"DethemeKit For Elementor is a versatile WordPress plugin designed to enhance your website building experience with Elementor. It offers a variety of customization options and tools for seamless designing."
- [dtk_current_year]
- [dtk_site_title]
DethemeKit For Elementor [dtk_current_year] Shortcode
The DethemeKit for Elementor plugin shortcode, ‘dtk_current_year’, displays the current year. It uses the PHP ‘gmdate’ function to get the year in ‘Y’ format.
Shortcode: [dtk_current_year]
Examples and Usage
Basic example – The ‘dtk_current_year’ shortcode from the DethemeKit for Elementor plugin is used to display the current year.
[dtk_current_year /]
PHP Function Code
In case you have difficulties debugging what causing issues with [dtk_current_year]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'dtk_current_year', [ $this, 'display_current_year' ] );
Shortcode PHP function:
function display_current_year() {
$dtk_current_year = gmdate( 'Y' );
$dtk_current_year = do_shortcode( shortcode_unautop( $dtk_current_year ) );
if ( ! empty( $dtk_current_year ) ) {
return $dtk_current_year;
}
}
Code file location:
dethemekit-for-elementor/dethemekit-for-elementor/widgets/de-copyright.php
DethemeKit For Elementor [dtk_site_title] Shortcode
The dethemekit-for-elementor plugin shortcode ‘dtk_site_title’ retrieves the title of your WordPress site. This shortcode calls the ‘display_site_title’ function, which uses the ‘get_bloginfo’ function to fetch the site’s name. If the site name exists, it returns the title.
Shortcode: [dtk_site_title]
Examples and Usage
Basic example – Displaying the site title using the dethemekit-for-elementor plugin shortcode.
[dtk_site_title /]
PHP Function Code
In case you have difficulties debugging what causing issues with [dtk_site_title]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'dtk_site_title', [ $this, 'display_site_title' ] );
Shortcode PHP function:
function display_site_title() {
$dtk_site_title = get_bloginfo( 'name' );
if ( ! empty( $dtk_site_title ) ) {
return $dtk_site_title;
}
}
Code file location:
dethemekit-for-elementor/dethemekit-for-elementor/widgets/de-copyright.php
Conclusion
Now that you’ve learned how to embed the DethemeKit For Elementor Plugin shortcodes, 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