WordPress.org

Support

Support » Plugins and Hacks » Display image attachements in unordered list on single.php

Display image attachements in unordered list on single.php

  • 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.

  • The topic ‘Display image attachements in unordered list on single.php’ is closed to new replies.
Skip to toolbar