• I am trying to edit the hierarchy of the permalinks for eoples comments.

    For example, on this page http://www.sandblasterinfo.com/homemade-modified/ it displays comments as sandblasterinfo.com/homemade-modified/comment-page-1/#comment-2425

    I believe this is the code that I have to edit in the comments-templete.php. How would I rewrite this so that comment-page-1 doesn’t show up in the permalink?

    if ( $wp_rewrite->using_permalinks() )
    			$link = user_trailingslashit( trailingslashit( get_permalink( $comment->comment_post_ID ) ) . 'comment-page-' . $args['page'], 'comment' );
    		else
    			$link = add_query_arg( 'cpage', $args['page'], get_permalink( $comment->comment_post_ID ) );
    	} else {
    		$link = get_permalink( $comment->comment_post_ID );
    	}
    
    	return apply_filters( 'get_comment_link', $link . '#comment-' . $comment->comment_ID, $comment, $args );
    }
  • The topic ‘Edit this code for permalink comments’ is closed to new replies.