Create Plugin/Widget or not
-
Hi All,
I am just starting with a widget/plugin and realized I am confused on two fronts, so I am hoping someone can shed some light.
I have a separate site (not WP) that has user-generated content (posts). I want to create a way for WP users to include this content. I have developed a widget on the site and it uses three code snippets, as many widgets do:
1) script tag to go in the header with link to external js
2) script tag to go in body to call function from the external js (there can be multiple of these and the result would just be multiple posts shown as widgets)
3) script tag to go after body for some final loadingSo it looks like this:
<head><script src="head.js"></script><head> <body> <script> contentId="123"; getContent(); </script> <script> contentId="456"; getContent(); </script> </body> <script src="bottom.js"></script>
So you can see that I load the head.js and bottom.js once, but may have more than one script in the body.
The code is generated on the site and, if someone does not use WP, this would be what they user. I would look to leverage this in a WP widget.
So my two points of confusion are:
1) Do I first need a plugin in order to have widgets? There could be multiple widgets (pointing to different posts) on various pages. Because of this, dont think a plugin is the correct option as that would be one instance per site. If that is correct, is a plugin needed as the foundation for the widget? I am looking to make this as easy for users.
2) Is it easier/better to just have WP users use the same widget. I know we can add javascript, but is it as convenient as a widget from the console?
Any thoughts are appreciated as my head is spinning from research
- The topic ‘Create Plugin/Widget or not’ is closed to new replies.