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 PHP programmer, but I am not familiar with WP yet (I do understand some basic things).

I have static page and I have to place a DOWNLOAD button on this page. Click on this button will allow user to download some document. But before user is allowed to download anything, div.popup appears where user is asked to fill in and submit email address.

I have about 5 buttons on page with different download files. All should act the same (ask email before download is allowed).

Can you, please, guide me how to properly achieve this in WP: 1) how to properly add such kind of button on static page on wp-admin part Can I add something like this in wp-admin page editor? Or shoudl I create some short_code thet will create this?

2) how to create div.popup with form before user is allowed to download I can create invisible div on the page and add some jquery when button is pressed. But how to submit this form? Maybe I can use ajax to send email and allow download. But what is the best opetion - where to place this code?

I can do this on pure PHP page, but I do not understand this in WP.

share|improve this question

1 Answer 1

It looks like you are creating an HTML form that allows you to interact with the user. This form would collect an email address and upon successul retrieval it would allow a file downlowd.

For forms, your best bet is to install a forms plugin. A very good form plugin that is easy to use is Contact Form 7.

What you have to do is create a page via WP-Admin area, then create a Contat Form 7 add-on, and embed it in your page.

share|improve this answer
    
I need div.popup to open on the same page instead of opening new page with form. –  renathy Jul 16 '13 at 20:06
    
You can use jQuery or JavaScript for that. However, make sure you do not link to jQuery the usual way, you have to enqueue them (in other words, WordPress comes with its own jQuery library, and you have to use the one that comes with WordPress, if you link to an external library, then you will have all sorts of conflicts). I suggest you read more about WordPress and how it works to be able to do that. If your project can wait a week, then buy a book or read online. –  Greeso Jul 16 '13 at 20:12
    
A good intro book is "Web Desiner's Guide to WordPress" and here is a link amazon.com/Web-Designers-Guide-WordPress-Launch/dp/0321832817/… –  Greeso Jul 16 '13 at 20:13
    
Btw, reading book is not good sollution for my problem. For now I do understand how to add contact form, hide/show it with jquery. The thing I do not understand - how to do some action after form is submitted. Is there some hook or something like this? –  renathy Jul 21 '13 at 10:39
    
No, embed your action withen the form itself, and check that if submitted, then do the action, prior to the fields. –  Greeso Jul 21 '13 at 14:04

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.