Skip to content

Instantly share code, notes, and snippets.

View Lego2012's full-sized avatar

Leo Merkel Lego2012

View GitHub Profile
<?php
/**
* Register/enqueue custom scripts and styles
*/
add_action( 'wp_enqueue_scripts', function() {
// Enqueue your files on the canvas & frontend, not the builder panel. Otherwise custom CSS might affect builder)
if ( ! bricks_is_builder_main() ) {
wp_enqueue_style( 'bricks-child', get_stylesheet_uri(), ['bricks-frontend'], filemtime( get_stylesheet_directory() . '/style.css' ) );
}
} );
@Lego2012
Lego2012 / toggle-do-not-disturb-ventura.jxa.js
Created January 19, 2025 16:29 — forked from stephancasas/toggle-do-not-disturb-ventura.jxa.js
Toggle Do Not Disturb Ventura AppleScript
#!/usr/bin/env osascript -l JavaScript
/**
* -----------------------------------------------------------------------------
* Toggle Do Not Disturb Mode from Control Center
* -----------------------------------------------------------------------------
*
* Created on May 18, 2023 by Stephan Casas
*
* Options:

Das 80/20-Prinzip, um schneller denn je zu lernen

„Ich möchte mehr über [Thema einfügen] lernen. Bitte wende das 80/20-Prinzip an und identifiziere die 20% der zentralen Informationen, Konzepte oder Prinzipien, die mir helfen, 80 % des Themas zu verstehen. Fasse die Erkenntnisse prägnant und klar zusammen, idealerweise in einer strukturierten Form (z. B. Punkte, Kategorien oder kurze Abschnitte). Falls

calc(33.333% - calc(calc(3rem * 2)/3))
calc(50% - calc(calc(3rem * 1)/2))
100 %
// Disable support for comments and trackbacks in post types
function disable_comments_post_types_support() {
$post_types = get_post_types();
foreach ($post_types as $post_type) {
if(post_type_supports($post_type, 'comments')) {
remove_post_type_support($post_type, 'comments');
remove_post_type_support($post_type, 'trackbacks');
}
}

Abstand der Bilder und Videos

.wp-block-image,
.wp-block-video,
.wp-block-embed {
    margin-top: 10rem !important;
    margin-bottom: 10rem !important;
}

Schatten der Bilder und Videos

<?php
/********************************************
* Register/enqueue custom scripts and styles
*/
add_action( 'wp_enqueue_scripts', function() {
// Enqueue your files on the canvas & frontend, not the builder panel. Otherwise custom CSS might affect builder)
if ( ! bricks_is_builder_main() ) {
wp_enqueue_style( 'bricks-child', get_stylesheet_uri(), ['bricks-frontend'], filemtime( get_stylesheet_directory() . '/style.css' ) );
}
} );

Steps to customize the admin columns

Add columns

You can use WordPress hooks such as manage_posts_columns or manage_${post_type}_posts_columns to customize the standard columns. For example, to add a new column for the post type “Books”, the code looks like this:

function my_custom_book_columns($columns) {
    // Neue Spalte hinzufügen
    $columns['book_author'] = __('Autor');
    return $columns;
}
$post_type = 'my_post_type';
// Register the columns.
add_filter( "manage_{$post_type}_posts_columns", function ( $defaults ) {
$defaults['custom-one'] = 'Custom One';
$defaults['custom-two'] = 'Custom Two';
return $defaults;
}
);