Jenis Patel
Jenis Patel

Reputation: 1615

How to create an embedded code for wordpress shortcode?

What I have done

I have a developed a custom WordPress plugin for displaying a custom calculator on my website. And regarding the same I have created a short-code for it which I am using to place it on any page of my website.

What I want to achieve

Now I want to create an embedded code for it so that by using that embedded code, we can place this calculator on any website. Means simply how we can create an embedded code for a short-code in WordPress.

I have an idea that we can achieve the same using iframe but still want some guidance on it.
Any help will be much appreciated.

Upvotes: 0

Views: 106

Answers (1)

Jenis Patel
Jenis Patel

Reputation: 1615

After analyzing the things, I have figured out that we can simply achieve it by following these steps :

1) Firstly create a WordPress page.

2) Create a separate custom page template for it and put the short-code there.

3) Remove the header (get_header) and footer (get_footer) from the page in case you want only the short-code content.

4) Create an embedded code which is basically a iframe tag having the permalink of that page as its source.

5) Provide this iframe tag/ embedded code to anyone who wants to display your WordPress short-code on their website.

Hope it helps someone else having the same requirements.

Upvotes: 1

Related Questions