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 / fix-ionos-mail.php
Created November 13, 2024 16:30
Remove subdomain from the From address to allow mails on IONOS hosting. (See: https://torstenlandsiedel.de/2024/02/26/mailprobleme-bei-ionos-mit-subdomains/)
<?php
/**
* Plugin Name: Fix IONOS Mail
* Description: Remove subdomain from the From address to allow mails on IONOS hosting.
* Plugin URI: https://torstenlandsiedel.de
* Version: 1.0.0
* Author: Torsten Landsiedel
* Author URI: https://torstenlandsiedel.de
* Licence: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
@Zodiac1978
Zodiac1978 / functions.php
Created September 11, 2024 09:48
Add new heading style for an outline
<?php
/**
* Block Styles
*
* @link https://developer.wordpress.org/reference/functions/register_block_style/
*
* @package WordPress
* @subpackage HeaderOutline
* @since HeaderOutline 1.0
*/
@Zodiac1978
Zodiac1978 / functions.php
Created September 3, 2024 11:14
Modify the meta viewport setting in the Divi theme
<?php
// Source: https://divi.help/threads/the-user-scalable-no-attribute-is-used-in-the-meta-name-viewport-element-or-the-maximum-sc.10458/
/**
* Remove the default viewport meta from Divi.
*/
function db_remove_et_viewport_meta() {
remove_action( 'wp_head', 'et_add_viewport_meta' );
}
add_action( 'after_setup_theme', 'db_remove_et_viewport_meta' );
@Zodiac1978
Zodiac1978 / functions.php
Last active July 25, 2024 09:23
Show modified and published date with translated date in Divi posts
<?php
// See: https://www.elegantthemes.com/blog/divi-resources/how-to-add-the-last-updated-date-to-divis-blog-post-meta-data#option-4-displaying-both-the-publish-and-last-updated-dates-without-time
function et_last_modified_date_blog( $the_date ) {
if ( 'post' === get_post_type() && !is_admin() ) {
$the_time = get_post_time( 'His' );
$the_modified = get_post_modified_time( 'His' );
$last_modified = sprintf( __( 'Zuletzt aktualisiert am %s', 'Divi' ), esc_html( get_post_modified_time( 'j. F Y', false, get_the_id(), true ) ) );
$published = sprintf( __( 'Veröffentlicht am %s', 'Divi'), esc_html( get_post_time( 'j. F Y', false, get_the_id(), true ) ) );
@Zodiac1978
Zodiac1978 / style.css
Last active June 17, 2024 13:58
Supreme Modules Lite (https://wordpress.org/plugins/supreme-modules-for-divi/) plugin has some minor issues which are easily fixed with some CSS
/*
Submit button aligment "center" does not work correctly:
https://stackoverflow.com/questions/72353817/contact-form-7-submit-button-alignment-issue
*/
.wpcf7-spinner {
display: block;
top: 15px;
left: 45%;
}
@Zodiac1978
Zodiac1978 / functions.php
Created June 11, 2024 07:33
Add two more user roles only for viewing and managing Koko Analytics
<?php
/* Add two more user roles for viewing and managing Koko Analytics */
/* See: https://www.kokoanalytics.com/kb/how-to-give-other-wordpress-users-access-to-the-koko-analytics-dashboard-page/ */
add_role( 'koko_analytics_viewer', 'Koko Analytics Viewer', array( 'read' => true, 'view_koko_analytics' => true ) );
add_role( 'koko_analytics_manager', 'Koko Analytics Manager', array( 'read' => true, 'view_koko_analytics' => true, 'manage_koko_analytics' => true ) );
@Zodiac1978
Zodiac1978 / wceu2024.md
Last active September 3, 2024 09:40
Hello WCEU2024! You want more details about the internal, native search? Here are my thoughts and links ...
@Zodiac1978
Zodiac1978 / repair-ajax-comments.php
Last active January 7, 2024 13:33
Repair AJAX comments for Antispam Bee in Streamtube theme (and maybe many more) - work in progress
<?php
/**
* Plugin Name: Repair AJAX comments for Antispam Bee
* Description: Add honeypot check and enable AJAX for Antispam Bee.
* Plugin URI: https://torstenlandsiedel.de
* Version: 1.0.0
* Author: Torsten Landsiedel
* Author URI: https://torstenlandsiedel.de
* Licence: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
@Zodiac1978
Zodiac1978 / wp-config.php
Created November 28, 2023 15:48
Disable the fatal error handler from WordPress
define( 'WP_DISABLE_FATAL_ERROR_HANDLER', true );
@Zodiac1978
Zodiac1978 / plugin-preview.html
Created October 10, 2023 15:09
WordPress plugin preview for from Roy Tanck modified to support Enter key for submit
<!DOCTYPE html>
<html lang="en">
<head>
<title>WordPress plugin preview</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="style.css">
</head>