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 | |
// 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' )){ |
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]); | |
} | |
} |
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 | |
// 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; |
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
/** | |
* 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; | |
} |
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
/** | |
* 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 { |
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 blocksy_dyn_block_pricelist($html, $block){ | |
if($block["blockName"] != "blocksy/dynamic-data") return $html; | |
if(!isset($block["attrs"]["field"])) return $html; | |
if($block["attrs"]["field"] != "acf:preisliste_text") return $html; // change acf field-name "preisliste_text" here | |
if($has_link = get_field("preisliste_link")) | |
$html = '<a href="'.$has_link.'" target="_blank">'.$html.'</a>'; | |
return $html; |
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 | |
// register the style selection for advanced posts block: | |
function register_block_styles() { | |
if ( function_exists( 'register_block_style' ) ) { | |
register_block_style( | |
'blocksy/query', | |
array( | |
'name' => 'mobile-slider', | |
'label' => __("mit Slider","lmdm") // change label to your needs | |
) |
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 | |
add_action("init", "init_blocks_and_patterns",100); | |
function init_blocks_and_patterns(){ | |
if(\WP_Block_Pattern_Categories_Registry::get_instance()->is_registered("blocksy")){ | |
unregister_block_pattern_category( 'blocksy'); | |
$blocksy_patterns = [ | |
"posts-layout-1", | |
"posts-layout-2", | |
"posts-layout-3", | |
"posts-layout-4", |
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 search_replacement($term){ | |
return ltrim(str_replace( array('0x'), array('0 x '), urldecode(strtolower($term)) )); | |
} | |
// ajax search: | |
function replace_search( $query_object ) | |
{ | |
if( $query_object->is_search() ) { | |
$raw_search = $query_object->query['s']; |
NewerOlder