- This topic has 3 replies, 2 voices, and was last updated 8 years, 10 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › Direct link to file instead of link to attachmentpage
Hello, my search results page display only attachment-pages from the medialibrary. When i click on a result it opens a new page where i can download the attachment. It works but i want the user to download the attachment directly from the resultspage. Is that possible?
The results.php template that this method uses is user editable/customizable, see here:
It uses HP to render elements/data, and the code is taken form the WordPress Codex. In you case you need to use this:
You need to be using the get_attachment_url, I think. See here:
https://codex.wordpress.org/Function_Reference/wp_get_attachment_url
Instead of the permalink. Exactly how to do this you may have to experiment with. The WP Codex will give some examples, as will the WordPress StackExchange.