Skip to content

Instantly share code, notes, and snippets.

@nicmare
Created July 30, 2025 08:30
Show Gist options
  • Save nicmare/d76a216a7e2a7ac1b57ac9fbaafdfe3c to your computer and use it in GitHub Desktop.
Save nicmare/d76a216a7e2a7ac1b57ac9fbaafdfe3c to your computer and use it in GitHub Desktop.
Change Blocksy Vertical Spacing based on taxonomy term
<?php
function change_blocksy_vertical_spacing($v_spacing_components){
global $post;
if($p_terms = get_the_terms( $post->ID, 'page_props' )){ // change "page_props" to your custom taxonomy name
if ( ! is_wp_error( $p_terms ) ) {
if(in_array("schwebende-navigation",array_column($p_terms,"slug"))){ // change "schwebende-navigation" to your term name
if (($key = array_search("top", $v_spacing_components)) !== false) {
unset($v_spacing_components[$key]);
}
}
}
}
return $v_spacing_components;
}
add_filter('blocksy:vertical-spacing:components','change_blocksy_vertical_spacing',10,2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment