{"id":742,"date":"2018-05-05T20:47:40","date_gmt":"2018-05-05T15:17:40","guid":{"rendered":"https:\/\/awpguide.com\/?p=742"},"modified":"2019-05-06T10:39:42","modified_gmt":"2019-05-06T05:09:42","slug":"how-to-show-comment-policy-in-genesis","status":"publish","type":"post","link":"https:\/\/awpguide.com\/wp-guides\/how-to-show-comment-policy-in-genesis\/","title":{"rendered":"How To Show Comment Policy In Genesis"},"content":{"rendered":"

Here at AWPGuide, we are showing a custom comment policy before our comments form. You know that we have built this child theme<\/a> on top of the Genesis Framework<\/a> by StudioPress<\/a>. Last day, some of our users asked how we made it and for the code. In this post, we will show you that how to show comment policy in Genesis.<\/p>\n

When Do You Need To Show Comment Policy?<\/h4>\n

If you are running a pretty huge blog, you must get spam comments on it. You know that removing website URL from the comments section will help you to stay away from spam.<\/p>\n

But, not forever.<\/p>\n

Some folks are commenting on blogs just for building backlinks. Well for those, you can show a comment policy and let them know how you filter comments and approve them!<\/p>\n

It’s an awesome method for us all.<\/p>\n

How To Show Comment Policy In Genesis<\/h2>\n

First of all, you need to create a page for showing your comment policy. We have a dedicated post on the topic. For more, you need to check out our post: how to create pages in WordPress<\/a>.<\/p>\n

Name your page as comment policy.<\/p>\n

\"wordpress<\/p>\n

You don’t need the page in search results. So, we need to add noindex for the page. Most of us are using Yoast SEO plugin<\/a> for on-page SEO. Under the Yoast SEO settings in the page, you can see an option for deindexing that specific page.<\/p>\n

\"yoast<\/p>\n

Making the option no will deindex the page and it will not show in search engines. That part is done. Add some contents to your comment policy page.<\/p>\n

\"contents<\/p>\n

Note that, you\u00a0don’t need to use a keyword for the page. Once you are done, publish the page.<\/p>\n

\"publish<\/p>\n

Keep the page URL in mind.<\/p>\n

Adding Comment Policy Before Comments<\/h4>\n

Here comes the main part. We have successfully created a comment policy page for our website. But, we haven’t added it before comments.<\/p>\n

You need to go to the theme editor and select the functions.php file.<\/p>\n

Copy the below code.<\/p>\n

function awpguide_change_note_after_comment_form($arg) {\r\n    $arg['comment_notes_after'] = '<p class="comment-notes">' . __( 'Thanks for leaving an awesome comment!' ) . '<\/p>';\r\n    return $arg;\r\n}\r\n\r\nadd_filter('comment_form_defaults', 'awpguide_change_note_after_comment_form');\r\n\r\nfunction awpguide_modify_text_before_comment_form($arg) {\r\n    $arg['comment_notes_before'] = '<p class="comment-policy">' . __( 'Thanks for leaving comments on our blog. All the comments are moderated through our <a title="AWPGuide Comment Policy" href="example.com\/comment-policy\/" target="_blank">comment policy<\/a>. Ao, no spamming allowed!' ) . '<\/p>';\r\n    return $arg;\r\n}\r\n\r\nadd_filter('comment_form_defaults', 'awpguide_modify_text_before_comment_form');<\/pre>\n

Paste the code on your functions.php file and update the file. Make sure that you have entered the link to your comment policy.<\/p>\n

\"how<\/p>\n

You can see the effect in the front end.<\/p>\n

\"new<\/p>\n

If you are not seeing this, it might be an issue with your cache. If you are using any caching plugins like WP Fastest Cache<\/a>, WP Super Cache<\/a> or WP Rocket<\/a>, you must clear your website cache. Also, try accessing your website in incognito mode.<\/p>\n

Some folks need to design the comment policy text.<\/p>\n

You can see that we have used a class\u00a0comment-policy<\/em> for the text. For styling your comment policy, you could use the CSS like:<\/p>\n

.comment-policy {\r\nfont-size: 15px;\r\nfont-weight: 500;\r\nfont-style: italic;\r\n}<\/pre>\n

Simply add this code in additional CSS section<\/a>. You can modify the code according to your needs.<\/p>\n

Will It Work With Other Themes?<\/h4>\n

No.<\/p>\n

You can only use this code on Genesis Framework<\/a>.<\/p>\n

This is how you can show comment policy in Genesis. We hope you found this post helpful and enjoyed the read. If you did, please consider sharing this post with your friends and fellow bloggers on social media.<\/p>\n

For more related posts, you may want to check out our blog section<\/a>. If you are a Genesis lover and need the perfect WordPress child theme, we recommend you Aspire Pro<\/a>. Check out our Aspire Pro review<\/a> and Aspire Pro documentation<\/a> for more.<\/p>\n","protected":false},"excerpt":{"rendered":"

Here at AWPGuide, we are showing a custom comment policy before our comments form. You know that we have built … <\/p>\n

Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":2057,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/awpguide.com\/wp-json\/wp\/v2\/posts\/742"}],"collection":[{"href":"https:\/\/awpguide.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/awpguide.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/awpguide.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/awpguide.com\/wp-json\/wp\/v2\/comments?post=742"}],"version-history":[{"count":0,"href":"https:\/\/awpguide.com\/wp-json\/wp\/v2\/posts\/742\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/awpguide.com\/wp-json\/wp\/v2\/media\/2057"}],"wp:attachment":[{"href":"https:\/\/awpguide.com\/wp-json\/wp\/v2\/media?parent=742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/awpguide.com\/wp-json\/wp\/v2\/categories?post=742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/awpguide.com\/wp-json\/wp\/v2\/tags?post=742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}