Problems with displaying file uploads…
Author | Posts |
---|---|
June 2, 2013 at 1:33 am 4416 | |
paperweight | I have 2 problems with file upload displays:
1) I am trying to show the file upload links on the Post page. I followed the instructions and added "file_uploads" to the code here, but it still does not show on my Post pages. Any idea why?
2) Also, I would like to have a small icon of a PDF or DOC next to each download link so the user knows if it is a PDF or DOC file. Is there a way to check the filetype and output a different pdf.jpeg or doc.jpeg? |
June 2, 2013 at 11:15 am 4429 | |
Tareq Hasan | 1. Check if you are getting the posts ID by using 2. As attachment ID’s are stored for each upload and you get the attachment ID in that |
June 2, 2013 at 3:21 pm 4432 | |
paperweight | 1) I also have images uploaded for a Post, and that code above works fine when using the correct mey_key_name for the image field. However for the file uploads they are not showing. When you say I should use 2) Ah, great thanks~ |
June 2, 2013 at 5:36 pm 4435 | |
Tareq Hasan |
|
June 2, 2013 at 7:07 pm 4441 | |
paperweight | Ok, I got it working 50%. I changed the code to the following:
Most importantly, I changed the However, the “My link text” does not display. Instead, it says “Missing Attachment” and then a link to the correct attachment. So, it is now correctly pointing to the correct attachment, but the linked text is incorrect. Any idea why it is saying “Missing Attachment”? |
June 2, 2013 at 7:26 pm 4442 | |
Tareq Hasan | I am not sure, but the quote around |
June 2, 2013 at 11:33 pm 4451 | |
paperweight | Yes, I removed and added the quotes around that a few times with other changes too but the Missing Attachment text always shows. WordPress says here http://codex.wordpress.org/Function_Reference/the_attachment_link that the Missing Attachment will display if an attachment can’t be found…. but I do have an attachment and that Missing Attachment text accurately links to that file. Very weird and I’m unclear how to fix this… |
June 3, 2013 at 4:46 pm 4473 | |
Tareq Hasan | So it’s actually displaying the image, but it’s showing the missing attachment text? Are you sure |
June 3, 2013 at 5:04 pm 4478 | |
paperweight | I have found a 75% solution and still working on it. I will post to this thread as soon as I get closer to 100% 😉 |
June 4, 2013 at 12:47 am 4524 | |
paperweight | ok so here is the code I am using now. It is about 85% to where I need it to be, but I can;t figure out anymore:
The array(32,32) seems useless so far and I can’t get it to display an icon to display a PDF image if the attachment is a PDF or a doc image if attachment is doc, etc. But the good news is it does display correctly the text “DOWNLOAD FILE” with the correct link to the attached file 🙂 I have a feeling some of my code above is useless, but it sort of works so far~ |