WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Automatically Open Post Images in New Window/Tab (3 posts)

  1. conceptmotion
    Member
    Posted 6 months ago #

    I was wondering if anyone could help me out with a bit of code...

    I'm trying to set up a WordPress theme to automatically open images that you put in posts in a new window/tab, without having to manually go into the HTML of every post and add the target="_blank" attribute to your tags.

    Is this possible?

    Thanks!

  2. esmi
    Theme Diva & Forum Moderator
    Posted 6 months ago #

    Please do not open links in new tabs or windows without warning the user in clear text on the page. This kind of site behaviour breaks the browser Back button & can leave some user groups stranded on the new tab with absolutely no way of getting back to your site.

    If your site contains decent content, your visitors will either make their way back to the page or will open links in new tabs using their controls in their own browsers.

  3. conceptmotion
    Member
    Posted 6 months ago #

    Thanks for the reply!

    I totally understand what you're saying. Normally, I don't have images open in new tabs. I just had a very specific situation that I was trying to work through. However, I did find another method to fix the problem without having to open the images in new tabs. So, it all worked out.

    Thanks for the help!

Reply

You must log in to post.

About this Topic