Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
    
I don't understand why it have -ve vote –  admin May 24 '11 at 5:24
add comment

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
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 May 23 '11 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. –  toscho May 23 '11 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 May 23 '11 at 11:55
1  
You can put any plugin code into your theme too, and it will work. –  toscho May 23 '11 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. –  toscho May 23 '11 at 12:43
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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