Hey Gregaizi,
Personally I would go the plugin route. This way, that piece of functionality isn’t directly tied to your theme. So in future if you wanted to switch themes, your plugins will follow.
Writing a plugin can be a very quick and dirty task, depending on how detailed you want to get. A plugin can range in size from 2-20000 lines of code.
Personally, I’d set it up so you can use a shortcode (or just a simple php snippet) to display your forms wherever you want.
But that’s just my personal opinion and other developers may prefer a separate route.
Evan
Thanks Evan for quick response.
The problem is that it looks scary to learn writing plugins…
I have a book Prof WP by Hal Stern, David Damstra, …
which scored highly at Amazon, but it starts describing the process of creating plugins with internationalization, and ‘creating plugin file’ without explaining what its filename is, suggesting having img folder under plugin…
I need only one page with the form. Is it truly necessary to write plugin?
No settings needed, but in future, I plan to use some subscriber’s info to customize the form for every subscriber.
Don’t worry about internationalizing the plugin, that’s really only necessary if you plan on spreading the plugin world wide. That step gets very intricate.
Take a look at this file on GitHub:
https://github.com/Wysija/barebone
It is a barebones, plugin with just the necessary files. The CSS and JS folders are not needed, you can delete them if you want. You can use this as a starting point, and just add what you need.
Notice how the main plugin file, index.php, has all that commented out code at the top of the file. This tells WordPress that it’s a Plugin, and the name, the author, version and a bunch of other meta-data.
If you don’t want to go the plugin route, you can always set up everything inside of Functions.php and then execute the necessary code as needed.
Thanks a lot, Evan.
That’s a real help.
If I change Functions.php it can be lost in future if I upgrade WP?
Bare Bone plugin is looking great.
If you add anything to your main parent theme, into style or functions, yes you will lose it if you upgrade your theme, not wordpress.
It’s smart to create a child theme if that’s the route you want to take. But again, personally I love plugin development, so I’d stick with the plugin (but that’s all preference)
Thanks a lot, Evan. I’ll try plugin development. It’s needed sooner or later anyway.
Thanks again.
Gershon
BTW, I loved singer Anna Herman 😉