Add html (span) to wp_get_attachment_link??
-
I have the following showing a link to an uploaded pdf…
<?php $attachs = get_posts(array( 'post_type' => 'attachment', 'post_parent' => get_the_ID(), 'numberposts' => -1 )); if (!empty($attachs)) { foreach ($attachs as $att) { if (wp_attachment_is_image($att->ID)) continue; echo '<li>' . wp_get_attachment_link($att->ID) . '</li>'; } } ?>
Is it possible to attach a span within the link with some text that appears for each link, like say ‘Download’?
Looking like this…?
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Add html (span) to wp_get_attachment_link??’ is closed to new replies.