Home›Types Community Support›[Closed] Display Media Library title and description of a (PDF) file field in PHP code
[Closed] Display Media Library title and description of a (PDF) file field in PHP code
The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 9 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.
I am trying to display the title as given in the Media Library directly in the theme code. My field currently looks like this in the code (but it only outputs the url):
The file is an uploaded PDF-file but I guess there must be a one-fits-all method to achieve this. I've been looking at code with arrays mostly for alt text, but it doesn't really makes sense to me (I'm not a programmer).
Basicly I need to achieve an output such as this:
<a href="/wp-content/uploads/2014/01/mydocument.pdf">(here comes the title from the Media Library)</a>
However, the media uploaded in the media library, is treated as the 'attachment' post type. You can retrieve attachments with a post, using the following code: