Alter Single Post “Blocks” for Posts in Specific Category
add_filter( 'wpex_blog_single_layout_blocks', function( $blocks ) {
// Alter blocks for specific category
if ( ! is_admin() && in_category( 'parent' ) ) {
/**** Available block names:
featured_media
title
meta
post_series
the_content
post_tags
social_share
author_bio
related_posts
comments
****/
// Remove meta
unset( $blocks['meta'] );
// Remove author box
unset( $blocks['author_bio'] );
}
// Return blocks
return $blocks;
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin (we recommend Code Snippets)