paranormalindonesiaonline.com Jasa Konsultasi Paranormal ramalan Feng Shui GRATIS, pelet jarak jauh. Hubungi Bpk.Pamera, HP: 085797189999 WhatsApp: 081910228999 PIN BBM paranormalindonesia : 265728CB

How To disable comments wordpress in Genesis Theme Framework

comments wordpress


Please note that this code is only can be used if you’re using Genesis Framework. simple tutorial, I’ll show you how to conditionally remove comments section To disable comments wordpress in Genesis Theme Framework. In one of the projects I did for a client, I need to remove the comments section for posts in link and video post format. Instead of having to disable the comments section every time when the client want to write a post in link or video post format, I want to make it easier him. When the client choose the link or video post format, the comments section will automatically disabled. In other words, the comments section isn’t there since I’ve completely remove it.

It’s really quite simple to disable commenting in WordPress, but before you do so — think about why you want to? Comments are a great way to stimulate conversation about your subject matter, products or services. But, with that being said, we understand there are certain reasons to disable commenting.

Here is the code to remove the comments sections site-wide:
// Remove post comments
add_action( 'wp_enqueue_scripts', 'custom_remove_comments' );
function custom_remove_comments() {
remove_action( 'genesis_after_post', 'genesis_get_comments_template' );
}

Thanks to Brian, the founder of StudioPress for the snippet.

Remove Comments Section on Post Format


And here’s the code I used for the project. What the code does is remove the comments section when the post is link or video post format.
// Remove post comments post format
add_action( 'wp_enqueue_scripts', 'custom_remove_comments' );
function custom_remove_comments() {
if ( 'link' == get_post_format() || 'video' == get_post_format() ) {
remove_action( 'genesis_after_post', 'genesis_get_comments_template' );
}
}

If you not using wp Genesis Theme Framework, Now I will give tips To Disable Comments in other WordPress theme

How To Turn Off WordPress Comments


Assuming you are running the most recent version of WordPress and depending your theme, there are a couple of different ways of turning off comments. 1. Disable Comments For All Posts: Login into your WordPress dashboard, go to Settings and click on discussion. From there, make sure the ‘Allow People To Post Comments on New Articles’ is unchecked. This will prevent your audience from leaving a comment on any post on your WordPress site.   comments wordpress 2. Disable Comments on Specific Pages or Posts: There may be some situations where you want people to comment on certain posts or pages, but not on others. WordPress has an easy way for you to accomplish this: Navigate to your WordPress dash and click on posts. Once there click on ‘All Posts’ and all your posts display. Roll your cursor over the post title and click on ‘Quick Edit’ when it displays. From there you will see your post (or page’s) commenting options. Unclick ‘Allow Comments’ and then save the changes. disable comments wordpress 3. Disable WordPress Comments in Genesis: Sometimes, when you work with a premium theme they will give you other ways or options to diable certain WordPress functionality. If your site uses Genesis or Thesis, from the WordPress Dash navigate to your themes’ settings. In Genesis, click on ‘Genesis’ and then click on ‘Theme Options’. This will bring up all the options your theme offers to make things a little easier for you to customize WordPress. Navigate down the screen to ‘Comments and Trackbacks’ and uncheck the appropriate box.

add or altering your site’s function.php file to disable your WordPress comments


@



0 komentar:

Posting Komentar - Kembali ke Konten

How To disable comments wordpress in Genesis Theme Framework