Support » Plugins and Hacks » Display image attachements in unordered list on single.php
8 years, 6 months ago
We could all do some really fun stuff with our photo galleries (jquery stuff) if we could spit them out into an unordered list on single.php.
On single.php, I’d like to do the following:
<li><a href="#medium-image"><img src="#thumbnail" /></a></li>
<li><a href="#medium-image-2"><img src="#thumbnail-2" /></a></li>
<li><a href="#medium-image-3"><img src="#thumbnail-3" /></a></li>
What code might one use on single.php to achieve the desired output? I’ve attempted the suggestions mentioned on this thread posted here.
But for whatever reason, when posted inside the loop on single.php it runs the loop for all posts that contain attachments.
Ideally, single.php would contain conditional logic that would only display the container divs and class for the gallery if a gallery exists.