WordPress.org

Ready to get started?Download WordPress

Forums

Gallery Shortcode (5 posts)

  1. djtodd
    Member
    Posted 5 years ago #

    I'm new to wordpress and apparently I've made a procedural mistake...

    I've been adding photos to my blog via the WP gallery. I actually quite like it, concise and easy to use.

    However there aren't many options to it, and I just want to make one SIMPLE change. Or it should be simple. Getting the thumbnail images to open to target="_blank" instead of the same window.

    Now I could go and re-do all of my images, or I could just quickly change the code controlling the gallery shortcode so that they all open to a new window.

    Any insight on how to go about doing this?

  2. djtodd
    Member
    Posted 5 years ago #

    I hate doing this, but BUMP.

  3. scoobasteve
    Member
    Posted 5 years ago #

    I would like to know this too :)

  4. scoobasteve
    Member
    Posted 5 years ago #

    got it.

    U have to add target='_blank' to the href in post-template.php on line 945

    return apply_filters( 'wp_get_attachment_link', "<a href='$url' target='_blank' title='$post_title'>$link_text</a>", $id, $size, $permalink, $icon, $text );

  5. neckermann
    Member
    Posted 4 years ago #

    scoobasteve have you found any other issues this might create? It seems to be working well, I just think maybe someone should put this in as a solution to this issue.

    Nicholas

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.