File URL
Author | Posts |
---|---|
March 30, 2013 at 4:28 pm 1649 | |
Nathan | Is there any way to get just the URL of a file upload? |
March 30, 2013 at 5:14 pm 1652 | |
Tareq Hasan | There is a shortcode to display link from a meta key: If you want it in code level, here’s how: if ($files) { It’s for multiple files with the same meta key. If you have single file in a meta key, then it’s simpler- |
March 31, 2013 at 9:24 am 1670 | |
Nathan | That shortcotee returns full hyperlink. I need just the URL to the file without the surrounding a tag. Is this possible? |
March 31, 2013 at 9:28 am 1671 | |
Tareq Hasan | Thats why I gave you three solutions. Use the last one, paste it in your themes single.php where you want to show the url. |
March 31, 2013 at 10:02 am 1674 | |
Nathan | Thanks Tareq. Your support is great 🙂 and your plugin is a life saver. |
March 31, 2013 at 11:23 am 1675 | |
Nathan | I’ve added it to my file like so:
<?php $full_url = wp_get_attachment_url( get_post_meta( $post->ID, ‘voucher_file’, true ) ); echo $full_url; ?>
But it isn’t returning anything. Am I doing it wrong? |
March 31, 2013 at 12:13 pm 1676 | |
Tareq Hasan | Do you actually have any value in that custom field? If it’s there, should be ok. |
March 31, 2013 at 1:51 pm 1678 | |
Nathan | Yep, just double checked. Here’s a test URL if that helps:http://bigbird.wearesmile.com/~shakes/passport-vouchers/tester/ |
March 31, 2013 at 2:13 pm 1680 | |
Tareq Hasan | Can you give me login and ftp details? |
March 31, 2013 at 2:18 pm 1681 | |
Nathan | Yes, but not publicly. can you send me your email? All code in thesis skin editor, through wordpress admin, woultaught be ok? |
March 31, 2013 at 2:24 pm 1682 | |
Tareq Hasan | You can post the details here as a private reply, that should be okay. I have no idea about thesis, but if the shortcode works fine and not the code, then may be some compatibility problem with thesis. |
March 31, 2013 at 2:50 pm 1683 | |
Nathan | I need an email address to set your account up… |
March 31, 2013 at 2:52 pm 1684 | |
Tareq Hasan | Email: support@wedevs.com |
March 31, 2013 at 3:02 pm 1685 | |
Nathan | This reply has been marked as private. |