Forums

Making commenter URLs open in a new window? (3 posts)

  1. ParrotPixels
    Member
    Posted 6 years ago #

    You know how when a user posts a comment and it displays a link to their website under their comment? How can you make that appear in a new window? Normally you'd put < a href="blahblah.html" target="_blank" > when using html, but I don't know what to do on wordpress. Please help! URL is at http://www.pp.yummieparadise.com for reference.

    Thanks! Stephie

  2. flammobammo
    Member
    Posted 6 years ago #

    Edit /wp-includes/comment-functions.php

    Assuming you have WP v2.0.2, modify line 378 to include the target='_blank' reference.

    For some reason this forum is giving me grief writing code in this post, so I've made a post on my blog for you here.

    I just tested it and it works. If you don't have v2.0.2 just search for that line of text.

    Just FYI, this modifies the get_comment_author_link() function which is called from your theme file, so if you swap themes this should still work, but if you upgrade WordPress to a new version after this hack then you will have to reapply the hack I guess.

  3. JanineD
    Member
    Posted 5 years ago #

    This worked for me!!! Thank you. I have been looking for a solution for a while now.

    I use version 2.0.4 and edited line 366 from the comment-functions.php file!!

Topic Closed

This topic has been closed to new replies.

About this Topic