Skip to content

Instantly share code, notes, and snippets.

@jan-koch
Created April 9, 2019 14:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jan-koch/e173daa2cc544b298bdf74d9236984d3 to your computer and use it in GitHub Desktop.
Save jan-koch/e173daa2cc544b298bdf74d9236984d3 to your computer and use it in GitHub Desktop.
Remove comments from the single post layout in the WP Astra theme. This snippet goes into your functions.php.
// Remove the default comments from Astra.
add_action(
'init',
function() {
if ( class_exists( 'Astra_Loop' ) ) {
remove_action( 'astra_template_parts_content', array( Astra_Loop::get_instance(), 'template_parts_comments' ), 15 );
}
},
11
);
@createscape
Copy link

Thanks!

@Nail757
Copy link

Nail757 commented Nov 19, 2022

It works, thanks!

@websprove
Copy link

Awesome, Thanks.

@jan-koch
Copy link
Author

jan-koch commented Sep 6, 2023

You're welcome, didn't even remember I have this file here. Glad it still is helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment