Skip to content

Instantly share code, notes, and snippets.

@nicmare
Last active August 1, 2025 09:19
Show Gist options
  • Save nicmare/cc4ca006bb245fa650b8417fbbade474 to your computer and use it in GitHub Desktop.
Save nicmare/cc4ca006bb245fa650b8417fbbade474 to your computer and use it in GitHub Desktop.
disable blocksy hero section based on an assigned term
<?php
// disable page title when assigned to schwebende navigation:
function disable_blocksy_hero_section($value){
global $post;
if(!$post->ID) return $value;
if($p_terms = get_the_terms( $post_id, 'page_props' )){ // replace "page_props" with your custom taxonomy name
if ( ! is_wp_error( $p_terms ) ) {
if(in_array("schwebende-navigation",array_column($p_terms,"slug"))){ // replace "schwebende-navigation" with your term
$value = false;
}
}
}
return $value;
}
add_filter('blocksy:single:has-default-hero', 'disable_blocksy_hero_section',10,2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment