I'd like to link to a file (uploaded in the dashboard) in the header menu. Is there any way to do this? Do I need to add a new page type that can do this?
I had to do this for a customer and there was no budget for fancy custom pages and that, so this is the quick hack way of doing it. If you have the time, you should really create a custom page that does the same but doesn't look so "hacky".
So first step: Create a custom attribute called "download" and of type "file" (you can call it whatever you want, but make sure the handler matches the code bleow)
Then, add a new page of any type and assign the file to the page attribute in "Custom Fields"
Last, open your elements/header.php inside your theme folder and stick this code at the top:
So first step: Create a custom attribute called "download" and of type "file" (you can call it whatever you want, but make sure the handler matches the code bleow)
Then, add a new page of any type and assign the file to the page attribute in "Custom Fields"
Last, open your elements/header.php inside your theme folder and stick this code at the top:
Done!