Two Column Comment Form

This snippet uses Javascript to break the WordPress comment form into two columns. These columns have Column Classes applied so they will match the site’s grid, scale down proportionally, and on small screens switch to a single column.

jQuery(document).ready(function($){
// Two Column Comment Form
// Author: Bill Erickson
// URL: http://www.billerickson.net/code/two-column-comment-form/
if( $('.comment-form-author').length ) {
$('.comment-form').prepend( '<div class="one-half comment-form-right" />' );
$('.comment-form').prepend( '<div class="one-half first comment-form-left" />' );
$('.comment-form-author').appendTo( '.comment-form-left' );
$('.comment-form-email').appendTo( '.comment-form-left' );
$('.comment-form-url').appendTo( '.comment-form-left' );
$('.comment-form-comment').appendTo( '.comment-form-right' );
}
});
view raw global.js hosted with ❤ by GitHub

Bill Erickson

Bill Erickson is the co-founder and lead developer at CultivateWP, a WordPress agency focusing on high performance sites for web publishers.

About Me
Ready to upgrade your website?

I build custom WordPress websites that look great and are easy to manage.

Let's Talk