Elementor Shortcode with Parameters

By Danielle

Elementor, a popular page builder for WordPress, offers a wide range of widgets and features to create stunning websites. One of its powerful functionalities is the ability to use shortcodes with parameters, enabling users to add dynamic content and functionality to their pages. In this guide, we'll delve into the world of Elementor shortcodes with parameters, exploring their benefits, how to use them, and providing practical examples.

JetEngine: WordPress Plugin for Elementor, Gutenberg & Bricks | Crocoblock
JetEngine: WordPress Plugin for Elementor, Gutenberg & Bricks | Crocoblock

Before we dive into the details, let's briefly understand what shortcodes are. Shortcodes are small pieces of code that allow you to do various things with minimal effort. They are enclosed in square brackets and can be inserted into posts, pages, or widgets. Elementor extends this functionality by offering its own set of shortcodes, which can be used to display content from various sources, such as posts, products, or custom fields.

an image of a black background with colorful text
an image of a black background with colorful text

Understanding Elementor Shortcodes with Parameters

Elementor shortcodes with parameters take the power of shortcodes to the next level. They allow you to customize the output of a shortcode by passing additional information in the form of parameters. This enables you to filter, sort, and display content in a way that best suits your needs.

Elementor free version Custom CSS - Master Addons
Elementor free version Custom CSS - Master Addons

Parameters are added to shortcodes using the following syntax: [shortcode parameter="value"]. The parameter is the name of the option you want to change, and the value is the new value you want to set. For example, [posts posts_per_page="3"] will display only three posts.

Benefits of Using Elementor Shortcodes with Parameters

Elementor Free vs Elementor Pro - Where are the differences
Elementor Free vs Elementor Pro - Where are the differences

Using Elementor shortcodes with parameters offers several advantages:

  • Dynamic Content: You can display content that changes based on user interactions or other factors.
  • Customization: Parameters allow you to customize the output of a shortcode to match your design and content needs.
  • Efficiency: Shortcodes save time and effort by automating repetitive tasks and reducing the need for manual coding.

Types of Parameters in Elementor Shortcodes

Learn coding | HTML | CSS | JavaScript
Learn coding | HTML | CSS | JavaScript

Elementor shortcodes support various types of parameters, including:

  • String: Text values enclosed in quotes, e.g., category="fashion".
  • Number: Numeric values, e.g., posts_per_page="3".
  • Boolean: True/False values, e.g., hide_empty="false".
  • Array: Multiple values separated by commas, e.g., categories="fashion, tech".

Using Elementor Shortcodes with Parameters in Practice

Elementor dashboard design - Alexey Savitskiy
Elementor dashboard design - Alexey Savitskiy

Now that we understand the basics of Elementor shortcodes with parameters, let's explore some practical examples.

Elementor offers a wide range of built-in shortcodes, such as [posts], [products], [testimonials], and more. Each of these shortcodes has its own set of parameters that can be used to customize their output.

The Beginner's Guide to Using Elementor in WordPress - FREE Step-by-Step Guide
The Beginner's Guide to Using Elementor in WordPress - FREE Step-by-Step Guide
an image of a web page that is designed to look like it has been made into a
an image of a web page that is designed to look like it has been made into a
an image of a website page with the text, easily add offset to outline
an image of a website page with the text, easily add offset to outline
Elementor Pro Wordpress Tutorial - The basics in 20 minutes
Elementor Pro Wordpress Tutorial - The basics in 20 minutes
Modern Rounded CTA Button Design in Elementor
Modern Rounded CTA Button Design in Elementor
Hotel Booking & Elementor Integration
Hotel Booking & Elementor Integration
Top 10 VS Code Shortcuts That Will 10X Your Productivity
Top 10 VS Code Shortcuts That Will 10X Your Productivity
Complete Beginner CSS Master Notes
Complete Beginner CSS Master Notes
Magic Navigation Menu, HTML and #CSS
Magic Navigation Menu, HTML and #CSS
the screenshoter is showing how to use different font and numbers for an app
the screenshoter is showing how to use different font and numbers for an app
How To Add Borders in Elementor WordPress Plugin? Tutorial
How To Add Borders in Elementor WordPress Plugin? Tutorial
HTML Input Types You Must Know (Beginner-Friendly Guide)
HTML Input Types You Must Know (Beginner-Friendly Guide)
an excel shortcut keys diagram with text and numbers on the bottom right corner,
an excel shortcut keys diagram with text and numbers on the bottom right corner,
an animated electric border for the source code - borderer, with text below it
an animated electric border for the source code - borderer, with text below it
CSS Pseudo-Elements Explained — ::before & ::after
CSS Pseudo-Elements Explained — ::before & ::after
a screenshot of a web page with the settings highlighted
a screenshot of a web page with the settings highlighted
the keyboard shortcuts sheet for adobe
the keyboard shortcuts sheet for adobe
Efecto Lluvia Matrix
Efecto Lluvia Matrix
an image of a computer program with numbers and symbols
an image of a computer program with numbers and symbols
the autocad 2d shortcut key is displayed in this screenshote
the autocad 2d shortcut key is displayed in this screenshote

Displaying a Specific Number of Posts

The [posts] shortcode allows you to display a specific number of posts using the posts_per_page parameter. For example, [posts posts_per_page="3"] will display the three most recent posts.

You can also use the order_by parameter to sort posts by various criteria, such as date, title, or comment count. For example, [posts order_by="comment_count"] will display posts with the most comments.

Filtering Products by Category

The [products] shortcode allows you to filter products by category using the category parameter. For example, [products category="electronics"] will display all products in the 'electronics' category.

You can also use the order_by parameter to sort products by price, popularity, or other criteria. For example, [products order_by="price"] will display products sorted by price.

Displaying Testimonials from Specific Authors

The [testimonials] shortcode allows you to display testimonials from specific authors using the author parameter. For example, [testimonials author="John Doe"] will display all testimonials from 'John Doe'.

You can also use the order_by parameter to sort testimonials by rating or date. For example, [testimonials order_by="rating"] will display testimonials sorted by rating.

Incorporating Elementor shortcodes with parameters into your web design allows you to create dynamic, engaging, and efficient content. By understanding and utilizing these powerful tools, you can take full advantage of Elementor's capabilities and create stunning websites with ease.