Hello Friends,
I am using wordpress blog and i want to do change when visitors/author give comment in post/article in wordpress blog,the author url/link should open in new window so when any visitor will look at comment and if they want to go in author's website than website will open in new window(target = '_blank'). Main objective is , visitor still have your site open in tab or window and they will not navigate from your wordpress blog.
Below is the solution how to add target='_blank' in comment url of your wordpress blog.
1) Logged in to FTP/C-Panel
2) Open wp-includes/comment-template.php
Find function get_comment_author_link
Find :
$return = "<a class="url" href="$url" rel="external nofollow">$author</a>"Replace :
$return = "<a class="url" href="$url" rel="external nofollow" target="_blank">$author</a>"
Now save that file and look at a post with comment. Surely it works.
To know more about programming,JavaScript issues,jQuery,Expression Engine,MYSQL database,php info,php editor,programming php,Open-source,php help and php script , subscribe to our feed by entering email address below. You will get updates via email about every tutorial posted on this site . It will not take more than a sec.
nice posting…
nice posting…
I have same configuration in my blogger blogspot.do you know how to navigate to commentators page in a new window in blogspot
I have same configuration in my blogger blogspot.do you know how to navigate to commentators page in a new window in blogspot
worked like a charm
excellent, work fine
Nice snippet.
I’ve got another way of doing it, and that DOESN’T REQUIRE EDITING WORDPRESS CORE. so in case if you update your wordpress in future you dont have to redo it again:
here’s the link http://webdeveloperswall.com/wordpress/add-target-blank-to-user-link-in-recent-comments-widget
February 8, 2010 at 5:33 am