0

I am developing a installable theme in wordpress I have created a contact form and called that form in footer but I want to create a widget that should be theme based mean i dont want any plugin.I can create a widget but for this i need to put the file in plugin folder that I don't want that should be completely theme based .

I want this because if I want to change the position of contact form like from footer to sidebar so for this I need to make this contact form widget that can be drag and drop in footer and sidebar.

I have searched this also on Internet but all are based on plugin directory so that Its not my requirement because it will activate whenever plugin will be activate but I need widget should activate whenever theme will be activate

Please provide me help or your suggestion I shall be very thankful to you Thanks

1
  • I don't understand why it have -ve vote
    – admin
    Commented May 24, 2011 at 5:24

1 Answer 1

4

A contact form is pure plugin stuff. It has to survive a theme switch. Put it into a plugin and prepare your stylesheet for the common possible positions.

9
  • I don't want this through plugin I have already mention in my question then why you are giving me the plugin suggestion.And its not long form it have only three field.I just want to do this functionality through function.php hope now the question is clear
    – admin
    Commented May 23, 2011 at 11:29
  • 3
    @admin Answers on this site should help anybody with the same problem or question. And my advise is not to put a contact form into a theme. I’ve done that and regretted it.
    – fuxia
    Commented May 23, 2011 at 11:36
  • 2
    @admin I completely agree with what @tocho is saying here. I too have added things like contact forms to themes in the past and it is a really bad idea. All it amounts to is more work that needs to be done during theme switch. The best thing that you can do is to register the widget in a plugin.
    – mfields
    Commented May 23, 2011 at 11:55
  • 1
    You can put any plugin code into your theme too, and it will work.
    – fuxia
    Commented May 23, 2011 at 12:22
  • 1
    @admin If you have a working plugin, put the file(s) into your theme directory and require the main file in the functions.php. That’s all.
    – fuxia
    Commented May 23, 2011 at 12:43

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.