Skip to content

Instantly share code, notes, and snippets.

@nicmare
nicmare / functions.php
Last active September 26, 2025 13:19
blocksy: disable content block tools in wp admin bar
<?php
function disable_blocksy_hook_panel(){
$user = wp_get_current_user();
if(in_array("editor",$user->roles)) return false;
return true;
}
add_filter('blocksy:content-blocks:has-actions-debugger','disable_blocksy_hook_panel');
@nicmare
nicmare / style.css
Created September 19, 2025 12:23
Blocksy Theme: making default archive cards fully clickable
[data-archive="default"].entries article.entry-card {
position:relative;
}
[data-archive="default"].entries article.entry-card .entry-title > a::before {
position:absolute;
inset: 0;
content:"";
display:block;
z-index:10;
@nicmare
nicmare / style.css
Created September 19, 2025 12:02
Blocksy: disable theme button hover effect transform
// add the class to your button:
.no-btn-transform:hover {
--theme-button-transform: none;
}
@nicmare
nicmare / functions.php
Created September 4, 2025 09:25
Hide WP Armour Admin Menu
<?php
// hide wp armour menu from editor role
function remove_wpa_menu(){
if(!is_admin()) return;
if(current_user_can('editor'))
remove_action('admin_menu', 'wpa_plugin_menu');
}
add_action("wp_loaded",'remove_wpa_menu');
@nicmare
nicmare / functions.php
Created September 4, 2025 09:11
Remove WP Armour Scripts from Homepage
<?php
// unload wp armour honeypot assets due to jquery dependency
function remove_plugin_stuff_in_wp_loaded(){
if(is_front_page())
remove_action('wp_enqueue_scripts','wpa_load_scripts');
}
add_action('wp', 'remove_plugin_stuff_in_wp_loaded');
@nicmare
nicmare / functions.php
Last active August 1, 2025 09:16
Disable Blocksy Hero Section with Title and Vertical Top Space based upon a term assignment
<?php
// disable page title and top spacing when assigned to "schwebende navigation" term of taxonomy "page_props":
function disable_blocksy_hero_section($value){
global $post;
if(!$post->ID) return $value;
$post_options = blocksy_get_post_options($post->ID);
// turns out (for some reason) $post->ID is more reliable than $post_id in certain cases!
if($p_terms = get_the_terms( $post->ID, 'page_props' )){
@nicmare
nicmare / functions.php
Created July 30, 2025 08:30
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]);
}
}
@nicmare
nicmare / functions.php
Last active August 1, 2025 09:19
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;
@nicmare
nicmare / style.css
Created July 23, 2025 09:36
blocksy archive item: span it across two or more rows:
/**
* add this to your theme style.css and change the aria-label value to your needs
*/
.entries article.entry-card:has(a[aria-label="2/1 Seite Panorama"]){
grid-column: 1 / 3;
}
.entries article.entry-card a[aria-label="2/1 Seite Panorama"] img {
aspect-ratio: 5 / 3 !important;
}
@nicmare
nicmare / style.css
Last active August 1, 2025 09:20
making blocksy archive item fully clickable and animating the shadow
/**
* put it in your themes style.css and change "blog" to your post type name
* if your CPT is "product", you change the value "blog" to "product_archive" or "rooms_archive"
*/
[data-prefix="blog"] .entries article.entry-card {
position:relative;
transition:box-shadow .15s ease-in-out, transform .15s ease-in-out;
}
[data-prefix="blog"] .entries article.entry-card .entry-title > a::before {