WordPress.org

Ready to get started?Download WordPress

Forums

Display image attachements in unordered list on single.php (1 post)

  1. Thad Allender
    Member
    Posted 6 years 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:

    <ul>
    <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>
    </ul>

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic