This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Link from Comment opening in a new window

Resolved 6 replies premiumthemetheme-vantage
11 years ago · Last reply by Andrew Misplon 11 years ago

Hi There,

When someone comments on my blog, they can input the URL to their own site for others to click on if they want to, which is great! But it would be nice if I could set this to open in a new window rather than navigate away from my page. I have checked the settings available in wordpress and I can’t see anything that helps, is there any tinkering I can do to make this possible? I’ve linked a post below that has comments on it.

Many Thanks

Lauren

URL: http://laurencariscooks.com/chai-tea-spiced-cupcakes/

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Replies

6
  1. Andrew Misplon Staff 11 years, 1 month ago

    Hey Lauren

    Is there a functions.php file in your child theme? Try this in functions:

    /**
     *  Comments template.
     */
    if ( ! function_exists( 'vantage_comment' ) ) :
    /**
     * Template for comments and pingbacks.
     *
     * Used as a callback by wp_list_comments() for displaying the comments.
     *
     * @since vantage 1.0
     */
    function vantage_comment( $comment, $args, $depth ) {
    	$GLOBALS['comment'] = $comment;
    	switch ( $comment->comment_type ) :
    		case 'pingback' :
    		case 'trackback' :
    			?>
    			<li class="post pingback">
    				<?php _e( 'Pingback:', 'vantage' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'vantage' ), ' ' ); ?>
    			<?php
    			break;
    		default :
    			?>
    			<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
    				<article id="comment-<?php comment_ID(); ?>" class="comment">
    					<footer>
    						<?php echo get_avatar( $comment, 50 ); ?>
    						<div class="comment-author">
    							<cite class="fn"><a href="<?php comment_author_url(); ?>" target="about_blank"><?php comment_author(); ?></a></cite>
    						</div><!-- .comment-author -->
    						<div class="comment-meta commentmetadata">
    							<a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><time datetime="<?php comment_time( 'c' ); ?>"><?php
    								/* translators: 1: date, 2: time */
    								printf( __( '%1$s at %2$s', 'vantage' ), get_comment_date(), get_comment_time() );
    								?></time></a>
    							<span class="support">
    								<?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    								<?php edit_comment_link( __( 'Edit', 'vantage' ), ' ' ); ?>
    							</span>
    						</div><!-- .comment-meta .commentmetadata -->
    						<?php if ( $comment->comment_approved == '0' ) : ?>
    							<em class="awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'vantage' ); ?></em>
    						<?php endif; ?>
    					</footer>
    					<div class="comment-content entry-content"><?php comment_text(); ?></div>
    				</article><!-- #comment-## -->
    			<?php
    			break;
    	endswitch;
    }
    endif; // ends check for vantage_comment()
  2. Andrew Misplon Staff 11 years, 1 month ago
  3. Ben Short 11 years, 1 month ago

    On behalf of Lauren (I’m her husband / live-in-tech-support)… thanks Andrew – this works a charm!

    • Greg Priday Staff 11 years, 1 month ago

      That made me smile. I’m currently a live-in-tech-support boyfriend. One day I hope I’ll get a promotion ;) Until WordPress do us part.

      • Ben Short 11 years, 1 month ago

        Haha I think all of us in our situation are hoping for that promotion! :)

    • Andrew Misplon Staff 11 years, 1 month ago

      Super, glad to hear that did the trick :)

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread