0

I am new to wordpress and working on something for a friend, I have FTP access, and am trying to upload a php file, that checks the platform and redirects the user either to the iTunes store if they are on an iOS device or force downloads a file if the user is on any other platform. I have the PHP file written, but it looks like wordpress pulls all it's information from a database and inserts it into templated pages. I need for users to just be able to access this page unless someone knows of a better method of doing this in wordpress. I need some help, can anyone point me in the right direction?

3
  • I think more context is in order. How are users accessing the download, for example?
    – s_ha_dum
    Commented Jul 24, 2015 at 15:24
  • I'd recommend instead using javascript to do the check, it works better with caching mechanisms
    – Tom J Nowell
    Commented Jul 24, 2015 at 15:25
  • well the idea would just be the user would click the download link, and from here, I can determine using PHP the platform so, i know if the user needs to be directed to iTunes to download a song for free, or if we can force the download. The problem with using javascript is I still need to set the headers using PHP to force the download, which I can't do using javascipt.
    – mcbeav
    Commented Jul 24, 2015 at 15:44

1 Answer 1

1

I guess you are talking about a specific page, for example domain.com/page? So you can create a generic page template (and select it for the page in WordPress admin panel) or create a template for the specific page. See instructions here.

In this template you can add your php code for the redirect.

If this redirection would be done for the whole site, not just one page, you can always edit the generic page template or the header.php file.

1
  • this did work for me. I really appreciate the help! I need to dig deeper into wordpress. thanks again!
    – mcbeav
    Commented Jul 24, 2015 at 15:49

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.