With the help of the code editor shortcodes, you can create shortcodes with the custom code snippets.
E.g. Suppose you have some custom HTML, CSS, PHP, JS code which you want to use and show it with shortcode.
Then, You can easily create the code shortcode and use the shortcode anywhere.
How to add the Code Shortcode? How to add the Code Shortcode?
- Go to Shortcodes > Add new
- You’ll see the Basic Shortcodes > Text Editor
- Then click on Create link
You’ll see something like below screenshot:
- Add the Shortcode Title
- The content which you want to show with shortcode
- And press the publish button
You’ll see the shortcode created into the sidebar something like: [shortcodehub id=’THE_ID’]
In above screenshot you’ll the shortcode is generated as: [shortcodehub id=’6016′]
Just copy the shortcode and use it anywhere.
Simple! right.Top ↑
How to use the created shortcode on Page? How to use the created shortcode on Page?
You can use the shortcode anywhere including page, post, products, widgets, etc.
For this demo, I’m using the shortcode on the page.
So, I’m doing:
- Create new page with title The Text Shortcode
- Paste the copied shortcode [shortcodehub id=’6011′] into the page content
- Click on Publish button to publish the page.
Now, When I visit to the page then, I can see:
- Page title as The Text Shortcode
- And the shortcode content