I am having a content sharing site where i share themes and gadgets for windows 7.
I am uploading the file using a custom field and storing its value in a custom field named durl.
Now I want to create a separate page called “Download” and when a user visits the posts page and when he clicks the download button, he must be forwarded to a new page where the download must start.
The new page “Download” must get the custom field value “$durl” from the post.
Is it possible? I have done it in codeigniter but no idea how to achieve this using wordpress.
Please guide me on that.
regards,
Rias
Here is another way you can do it.
Create a Downloads template by copying page.php and have this in your new template:
Fill the template with header, footer, etc like page.php. Create a new page in WordPress and assign the template “Downloads” to it.
In your original post (single.php) for example, create the download link dynamically like this:
The user will be redirected to Downloads page which you just created. You need to put this code in your downloads template / page:
And it should print the custom field value in downloads page (which is the download link related to your post)
The idea of this code is to pass the post ID in $_GET and use the post ID to get the download link via its custom field.