0

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.

3
  • if your code is at all dependent on the wordpress framework, it will most likely not be possible, unless you are sure that you have a framework agnostic plugin. Commented Jan 15, 2015 at 6:11
  • yes, plugin is developed as per WordPress plugin development standards and hence dependent on WordPress. Commented Jan 15, 2015 at 6:51
  • iframe is a good way, you can hide all other elements and it will look like a native calculator on the other sites, why not? Commented Jan 15, 2015 at 7:57

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.