AnyWhere Elementor Shortcode

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

Before starting, here is an overview of the AnyWhere Elementor Plugin and the shortcodes it provides:

Plugin Icon
AnyWhere Elementor

"AnyWhere Elementor is a powerful WordPress plugin that allows users to design unique layouts for any area of their website. It offers complete design freedom with its user-friendly interface."

★★★★☆ (97) Active Installs: 90000+ Tested with: 6.3.2 PHP Version: false
Included Shortcodes:
  • [INSERT_ELEMENTOR]

AnyWhere Elementor [INSERT_ELEMENTOR] Shortcode

The Anywhere Elementor shortcode ‘INSERT_ELEMENTOR’ dynamically inserts Elementor content into your pages. This shortcode checks if Elementor is active, then fetches the content associated with the given ID. It also supports WPML & Polylang for multilingual sites.

Shortcode: [INSERT_ELEMENTOR]

Parameters

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

  • id – The unique ID of the Elementor template to be displayed.

Examples and Usage

Basic example – Inserting an Elementor template with a specific ID

[INSERT_ELEMENTOR id=123 /]

Advanced examples

Example 1 – Inserting multiple Elementor templates by specifying their IDs. Please note that each template will be rendered in the order they are listed.

[INSERT_ELEMENTOR id=123 /]
[INSERT_ELEMENTOR id=456 /]
[INSERT_ELEMENTOR id=789 /]

Example 2 – Embedding an Elementor template within a blog post or a page. By wrapping the shortcode in paragraph tags, the template will be displayed as part of the content.

[INSERT_ELEMENTOR id=123 /]

Please note that the ‘id’ parameter in the shortcode corresponds to the ID of the Elementor template you want to display. You can find the ID of a template by navigating to Elementor > My Templates in your WordPress dashboard. The ID is listed in the ID column.

PHP Function Code

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

Shortcode line:

add_shortcode('INSERT_ELEMENTOR', [$this, 'render_shortcode']);

Shortcode PHP function:

function render_shortcode($atts){
        
        // Enable support for WPML & Polylang
        $language_support = apply_filters('ae_multilingual_support', false);

        if(!class_exists('Elementor\Plugin')){
            return '';
        }
        if(!isset($atts['id']) || empty($atts['id'])){
            return '';
        }

        $post_id = $atts['id'];

        if($language_support){
            $post_id = apply_filters( 'wpml_object_id', $post_id, 'ae_global_templates' );
        }

        $response = Plugin::instance()->frontend->get_builder_content_for_display($post_id);
        return $response;
    }

Code file location:

anywhere-elementor/anywhere-elementor/includes/shortcode.php

Conclusion

Now that you’ve learned how to embed the AnyWhere Elementor 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 *