WordPress.org

Support

Support » Themes and Templates » Hiding previous_image_link() if blank

Hiding previous_image_link() if blank

  • jobbogamer
    Member

    @jobbogamer

    Hi, I’m using the previous_image_link() on my single attachment page, but because I’ve given the div a background in the CSS, even when there isn’t a previous image to link to, there’s an empty box there.

    Is there a way to check if a previous image exists before adding the div, so that it doesn’t show up when the link isn’t there?

    Thanks in advance.

  • The topic ‘Hiding previous_image_link() if blank’ is closed to new replies.