Created
July 30, 2025 08:30
-
-
Save nicmare/d76a216a7e2a7ac1b57ac9fbaafdfe3c to your computer and use it in GitHub Desktop.
Change Blocksy Vertical Spacing based on taxonomy term
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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