Skip to content

Instantly share code, notes, and snippets.

View Zodiac1978's full-sized avatar
🤔
Overthinking things since 1978

Torsten Landsiedel Zodiac1978

🤔
Overthinking things since 1978
View GitHub Profile
@Zodiac1978
Zodiac1978 / wp-config.php
Created March 4, 2022 16:23
Log errors in debug.log in /wp-content-folder on production server (prevent public access to this file!)
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', true );
@Zodiac1978
Zodiac1978 / .htaccess
Last active October 3, 2022 08:22
Redirect from http to https
# Redirect from http to https
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
@Zodiac1978
Zodiac1978 / custom-pattern.php
Last active May 16, 2021 18:21
Custom Pattern for Antispam Bee: Invalid URL and only one word as name and in content
<?php
/**
* Plugin Name: Custom Patterns for Antispam Bee
* Description: Add custom patterns for Antispam Bee.
* Plugin URI: https://torstenlandsiedel.de
* Version: 1.0
* Author: Torsten Landsiedel
* Author URI: https://torstenlandsiedel.de
* Licence: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
@Zodiac1978
Zodiac1978 / style.css
Last active March 13, 2021 19:40
Responsiveness Spalten-Block anpassen - CSS-Lösung für das hier beschriebene Problem: https://die-netzialisten.de/responsiveness-spalten-block-anpassen/
/*
Sources:
https://stackoverflow.com/questions/8720931/can-css-detect-the-number-of-children-an-element-has
https://lea.verou.me/2011/01/styling-children-based-on-their-number-with-css3/
*/
@media (min-width:600px) and (max-width:781px) {
.wp-block-column:first-child:nth-last-child(3) {
flex-basis: 100% !important;
}
@Zodiac1978
Zodiac1978 / functions.php
Created February 8, 2021 12:07
Remove divi shortcodes from attached pages in Germanized for Woocommerce plugin mails
<?php
/**
* Just return the content
*
* @param [string] $atts Unused attributes.
* @param [string] $content Submitted content.
* @return [string] Unmodified content with shortcodes because of nested shortcodes.
*/
function divi_remove_shortcodes( $atts, $content ) {
@Zodiac1978
Zodiac1978 / custom-editor-style.css
Last active February 4, 2021 21:11
Override editor colors in (twenty eleven) child theme
/*
Theme Name: Twenty Eleven
Description: Custom colors.
*/
body {
color: #fff;
background: #ddd;
}
@Zodiac1978
Zodiac1978 / projekt26-2021.md
Last active November 25, 2021 08:52
Teilnehmerinnen und Teilnehmer sowie alle Beiträge zur #Projekt26 Challenge im Jahr 2021

Am 28.12.2019 habe ich mit einem Tweet zur #Projekt26 Challenge herausgefordert. Alle zwei Wochen bloggen und kommentieren, über Wordpress oder Verwandtes, in Deutsch oder Englisch. Auch in 2021 geht es weiter!

Alle Details dazu in diesem Artikel: https://torstenlandsiedel.de/2019/12/28/projekt26-jetzt-erst-recht/

Und das Fazit aus dem Jahr 2020: https://torstenlandsiedel.de/2020/12/13/das-projekt26-geht-bald-zu-ende/

KW 27+28

KW 25+26

@Zodiac1978
Zodiac1978 / sample.html
Last active August 17, 2022 07:11
Gutenberg sample content based on https://artisanthemes.io/sample-content-blocks-gutenberg/ but with working placeholders (WIP)
<!-- wp:paragraph {"align":"center","backgroundColor":"very-light-gray","fontSize":"small"} -->
<p class="has-text-align-center has-very-light-gray-background-color has-background has-small-font-size"><p style="color:#000000;text-align:center" class="has-background has-small-font-size has-very-light-gray-background-color">Gutenberg Sample Content.<br>Put together with ❤️ by <a href="https://artisanthemes.io/">Artisan Themes</a> and me.</p></p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level":1} -->
<h1>This is a heading (H1)</h1>
<!-- /wp:heading -->
<!-- wp:heading -->
<h2>This is a heading (H2)</h2>
@Zodiac1978
Zodiac1978 / custom-toolbar.php
Created December 5, 2020 14:34
Add new menu for custom toolbar items
<?php
/**
* Plugin Name: Custom Toolbar
* Description: Add custom toolbar items in frontent to check page and/or site.
* Plugin URI: https://torstenlandsiedel.de
* Version: 1.0
* Author: Torsten Landsiedel
* Author URI: http://torstenlandsiedel.de
* Licence: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
@Zodiac1978
Zodiac1978 / functions.php
Created November 5, 2020 14:35
Add Divi markup to fix restrict content.
<?php
/**
* Add Divi markup to fix restrict content.
*/
function divi_compatibility( $content ) {
global $post, $current_user;
$hasaccess = pmpro_has_membership_access( null, null, true );