Comments

Overview

Comments are a great way for the website users to have an online interaction over any topic. By default, WordPress comments can be enabled or disabled on any post. However, if you would like to design a post using Advanced Layout Builder, the default WordPress loop is not used by the theme, hence comments will only show on the posts using ALB when a comment element is used.

More info about WordPress comments on WordPress Codex.

Enfold theme comments demo.

How to Enable/Disable Comments on posts and pages.

Enfold theme supports creating posts/pages using the default WordPress editor or Advanced Layout builder. If a page/post is designed using ALB, the comments will not show by default, as the theme uses a different loop.

Default WordPress Editor: If you are using the default WordPress editor to create a post/page, to enable or disable the comments:

  1. Login as admin and open the post/page on which you like to enable or disable the comments
  2. Scroll down to the bottom of the page and look for Discussion option.
  3. If you do not see the Discussion option check the screen options on the top right of the page and select the Discussion box.

For more options on comments, and to make changes sitewide please go to the WordPress Dashboard > Settings > Discussion Settings.

Advanced Layout Builder: While using enfold theme ALB drop the comments element anywhere on the post/page and a comment box will show up.

Code Snippets

How to use the snippets?

NOTE: If the code snippets produce a different result on your site, it may be because the settings on your site are different or due to any customization already added to achieve a similar result. Please try removing your customization if any and feel free to change the values in the example codes to suit your design.

Shortcode

 [av_comments_list av-desktop-hide='' av-medium-hide='' av-small-hide='' av-mini-hide='' av_uid='av-79s2f5'] 

Customization

Align comment form elements

By default, the label appears on the right side of the form fields as seen below.

To position the label on top of the form fields as seen below please use the custom CSS provided.

Code snippet


/*-----------------------------------------
CSS - Comment labels on top of the forum fields
----------------------------------------- */
#top #commentform label {
    position: relative;
    left: 0;
}

Input fields on the same line

By default input fields are stacked on top of each other, to place the input fields on the same line with a full-width post comment button please use the below code snippet.

Code snippet


/*-----------------------------------------
CSS - Comment form fields on same line
----------------------------------------- */
#top #commentform label {
    position: relative;
    left: 0;
}

#commentform .comment-form-author,
#commentform .comment-form-email,
#commentform .comment-form-url
{ 
  display:inline-block;
}
#commentform .form-submit input {
  width:100%;
}

Comment box Background

The easiest way to change the background color for the comments section is to drop it in a color section element and update the background color/image of the color section.

Comment form input field width

To make the comment fields full width as seen below please use the code snippet available for this modification.

Code snippet


/*----------------------------------------
// full-width comment fields
//--------------------------------------*/
#top #commentform label{
  position:relative;
  left:0;
}
#top #commentform input{
  width:100%;
}

Comment field at the bottom

To change the order of the comments field and place it at the bottom as shown in the below picture use the provided function in your child theme functions.php file.

Code snippet

How to change comment box text

If you are using the advanced layout builder to design your blog post and like to change the comment box text, copy the code below to your functions.php file and replace the “New text here” with your custom text for the comment box title, sub-heading and the post comment button.

Code snippet

How to deal with spam comments

Spam comments can be pretty annoying and lower your site credibility. To make it hard for anyone to spam your site with comments you can try installing CAPTCHA and change the settings in WordPress Dashboard > Settings > Discussion

Google Captcha
reCaptcha
Easy Captcha

WordPress Codex provides an in-depth explanation to handle spam comments.

Resource

There are many comment plugins with advanced features available for WordPress. Some of which that are worth mentioning are:

Disqus
Jetpack
Facebook Comments

Contributed video:

Comments Element Tutorial