Skip to content

Instantly share code, notes, and snippets.

@zartgesotten
zartgesotten / bb-image-hover.css
Last active June 27, 2023 15:39
Instruction: Add two image modules above each other, add the class .bild-normal to the first one and the class .bild-hover to the second one... add this css and save. Boom!
/* Bildeffekt - Bildtausch bei Hover */
/* Übergeordneten container relativ positionieren */
body:not(.fl-builder-edit) .bild-normal {
position:relative;
}
/* BILD im container absolut positionieren */
body:not(.fl-builder-edit) .bild-normal img {
position:absolute;
<?php
// Add Shortcode
function spnews() {
// get option field content
$sphinweis = get_field('aktueller_hinweis', 'option');
$sphinweis_row = '<!-- wp:generateblocks/container {"uniqueId":"0bb2fe18","anchor":"ic","backgroundColor":"var(\u002d\u002dbackground-lite)","isDynamic":true,"blockVersion":3,"useGlobalMaxWidth":true,"marginRight":"auto","marginBottom":"60","marginLeft":"auto","marginBottomMobile":"40","paddingTop":"60","paddingBottom":"60","borderRadiusTopRight":"15","borderRadiusBottomRight":"15","borderRadiusBottomLeft":"15","borderRadiusTopLeft":"15","useGlobalStyle":true,"globalStyleId":"insidecontainer"} -->
<!-- wp:generateblocks/container {"uniqueId":"1504dc64","isDynamic":true,"blockVersion":3,"useGlobalMaxWidth":true,"marginRight":"auto","marginLeft":"auto","paddingBottom":"0","globalStyleId":"insidecontainer"} -->
<!-- wp:generateblocks/headline {"uniqueId":"a499d2a5","blockVersion":2,"backgroundColor":"","textColor":"","linkColor":"","linkColorHover":"","borderColor":"","highlightTextColo
.bubblecol{
--card-shape: 48% 52% 58% 42% / 48% 25% 75% 52%;
--card-hover-shape: 50%;
--heading-shape: 50%;
--heading-hover-shape: 61% 39% 38% 62% / 67% 49% 51% 33%;
--heading-background: #eff0f4;
--heading-circle-size: 80px;
--bubble-color: #ffffff;
}
.bubblecol{
<script>
function colorModeSwitcher() {
var element = document.getElementById("main");
element.classList.toggle("dark-mode");
}</script>
img {
max-width: 300px;
max-height: 300px;
object-fit: contain;
object-align:right;
}
This file has been truncated, but you can view the full file.
a:2:{s:12:\"Font Awesome\";s:579449:\"<?xml version=\"1.0\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" style=\"position: absolute; width: 0; height: 0; overflow: hidden;\" version=\"1.1\">\n<defs>\n<symbol id=\"FontAwesomeicon-asterisk\" viewBox=\"0 0 26 28\">\n<title>asterisk</title>\n<path d=\"M23.156 16.406c0.953 0.547 1.281 1.781 0.734 2.734l-1 1.719c-0.547 0.953-1.781 1.281-2.734 0.734l-4.156-2.391v4.797c0 1.094-0.906 2-2 2h-2c-1.094 0-2-0.906-2-2v-4.797l-4.156 2.391c-0.953 0.547-2.187 0.219-2.734-0.734l-1-1.719c-0.547-0.953-0.219-2.188 0.734-2.734l4.156-2.406-4.156-2.406c-0.953-0.547-1.281-1.781-0.734-2.734l1-1.719c0.547-0.953 1.781-1.281 2.734-0.734l4.156 2.391v-4.797c0-1.094 0.906-2 2-2h2c1.094 0 2 0.906 2 2v4.797l4.156-2.391c0.953-0.547 2.188-0.219 2.734 0.734l1 1.719c0.547 0.953 0.219 2.188-0.734 2.734l-4.156 2.406z\"/>\n</symbol>\n<symbol id=\"FontAwesomeicon-plus\" viewBox=\"0 0 22 28\">\n<title>plus</title>\n<path d=\"M22 11.5v3c
/*prevent horizontal scroll*/
html, body {
overflow-x: hidden;
}
body {
position: relative
}
@zartgesotten
zartgesotten / gb-default-paddings.php
Last active January 7, 2023 09:23
By default, Generate Blocks has empty paddings for new containers. This means, for every container, you have to set paddings for three sizes manually. This snippet adds some default paddings to start from.
add_filter( 'generateblocks_defaults', function( $defaults ) {
$defaults['container']['paddingTop'] = '30';
$defaults['container']['paddingRight'] = '30';
$defaults['container']['paddingBottom'] = '30';
$defaults['container']['paddingLeft'] = '30';
$defaults['container']['paddingTopTablet'] = '30';
$defaults['container']['paddingRightTablet'] = '30';
$defaults['container']['paddingBottomTablet'] = '30';
$defaults['container']['paddingLeftTablet'] = '30';
$defaults['container']['paddingTopMobile'] = '20';
@zartgesotten
zartgesotten / site-css.css
Last active December 31, 2022 15:45
align last element in a container (CTA or read more button) to the bottom, no matter how high the content before is. Add class .align-buttons to container. https://community.generateblocks.com/t/grid-items-with-different-content-heights-aligned-botto
.align-buttons .gb-inside-container {
display: flex;
flex-direction: column;
height: 100%;
}
.align-buttons .gb-inside-container > *:last-child {
margin-top: auto;
}
<?php
add_action( 'delete_attachment', function( $postid ) {
$past_backtrace = get_option( 'backtrace_for_deletion', [] );
$current_backtrace = debug_backtrace();
$past_backtrace[] = json_encode( $current_backtrace );
update_option( 'backtrace_for_deletion', $past_backtrace );
});
$backtraces = get_option( 'backtrace_for_deletion' );