Echoing media by categories
-
How can I simply echo the name and link of a non-image file(s) by category via php?
For example, if I upload a pdf, assign a category to it, how can I then output it? normally, I would do something like
<ul> <?php $files =& get_children(); foreach ((array) $files as $attachment_id => $attachment) { if(wp_get_attachment_link($attachment_id) != "Missing Attachment") { ?><li><?php echo wp_get_attachment_link($attachment_id); ?></li><?php } } ?> </ul>I have been searching this plugin page but cannot find a simple comprehensive documentation guide (probably because I’m new to wordpress… but still very comfortable with php).
In “the other” wordpress Media Category plugin they have simple shortcodes like [mediacat cats=”Documents”]. What is the usage here? Or if this question has already been answered, could you please direct me to that documentation?
Much thanks.
The topic ‘Echoing media by categories’ is closed to new replies.