Skip to content

Instantly share code, notes, and snippets.

View gmmedia's full-sized avatar

Jochen Gererstorfer gmmedia

View GitHub Profile
@gmmedia
gmmedia / PHP Mailer Configuration for WordPress.php
Created November 29, 2022 20:28 — forked from nextab/PHP Mailer Configuration for WordPress.php
Just define the globals in wp-config.php and add the code snippet in your functions.php to send e-mails via SMTP instead of the regular php mailer.
Folgenden Code unter übliche wp-config-.php-Befehle einfügen: (Auf All-Inkl angewandt - andere Host-Daten müssten dementsprechend angepasst werden...)
define( 'SMTP_USER', 'm05f2ew1' ); // Postfach-Benutzer
define( 'SMTP_PASS', 't3stpwd' ); // Postfach-Passwort
define( 'SMTP_HOST', 'w01c1234.kasserver.com' ); // Postein- und Ausgangsserver
define( 'SMTP_FROM', 'mail@example.com' ); // Gewünschte E-Mail-Adresse zum Versenden
define( 'SMTP_NAME', 'Example Website' ); // Webseiten-Name
define( 'SMTP_PORT', '465' ); // SMTP-Port - häufig 465 oder 587 (auch 25, aber unsicher)
define( 'SMTP_SECURE', 'ssl' ); // Verschlüsselungstyp (auch tls möglich)
define( 'SMTP_AUTH', true ); // SMTP-Authentifikation
@gmmedia
gmmedia / functions.php
Created September 25, 2022 12:28
Kadence Cloud Settings: Pro Tag
/**
* Apply a pro tag based on the cloud library category.
*
* @param boolean $enabled true or false based on if pro.
* @param object $post the current cloud library item post object.
* @param array $request_extras an array of extra information.
* @return Boolean based on if access should be labeled pro.
*/
function custom_kadence_cloud_add_pro_tag( $enabled, $post, $request_extras ) {
if ( has_term( 'pro', 'kadence-cloud-categories', $post ) ) {
@gmmedia
gmmedia / functions.php
Last active August 4, 2022 12:49
WP Glossary - Add Gutenberg Support
<?php
// WP Glossary - Add Gutenberg Support
// Need help: https://bloggerpilot.com/snippet-wp-glossary-gutenberg/
// Add support for Gutenberg
add_filter ( 'wpg_post_type_glossary_args', 'bp_wpg_post_editor' );
function bp_wpg_post_editor ( $args ) {
$args['show_in_rest'] = true; // for Gutenberg Editor
return $args;
}
@gmmedia
gmmedia / functions.php
Created July 27, 2022 12:28
Add Media Library Column: File Size
<?php
// Add Media Library Column: File Size
// Need help: https://bloggerpilot.com/snippet-media-filesize/
add_filter('manage_upload_columns', 'bp_add_column_file_size');
add_action('manage_media_custom_column', 'bp_column_file_size', 10, 2);
add_action('admin_head', 'bp_add_media_styles');
// Create the column
function bp_add_column_file_size($columns)
<?php
/**
* Modify search query to ignore the search term in HTML comments.
*
* @param string $where The WHERE clause of the query.
* @param WP_Query $query The WP_Query instance (passed by reference).
*
* @return string The modified WHERE clause.
*/
@gmmedia
gmmedia / functions.php
Last active March 11, 2023 10:03
Yoast SEO Score column fix
<?php
// Yoast SEO Score column fix
add_action('admin_head', 'bloggerpilot_fix_yoast_score_column');
function bloggerpilot_fix_yoast_score_column() {
echo '<style>#wpseo-score {float: unset;margin: unset;}</style>';
echo '<style>.column-ppc_checklist{width: 12%;}</style>';
}
@gmmedia
gmmedia / wp-config.php
Created May 16, 2022 12:40
WordPress SVG upload error: Add this line to the end of your wp-config.php
define('ALLOW_UNFILTERED_UPLOADS', true);
@gmmedia
gmmedia / SVG image
Last active May 16, 2022 12:40
SVG: declaration: Add this line to the top of you SVG, if you can't upload it to WordPress.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
@gmmedia
gmmedia / style.css
Last active February 20, 2023 03:51
Kadence Timeline Block
/*
* Create Timeline Block with the Kadence Icon List Block
* See: https://bloggerpilot.com/timeline-css/
*/
.timeline li {
list-style: none;
padding-bottom: 1.8rem !important;
border-left: 1px dotted #897B76;
position: relative;
@gmmedia
gmmedia / functions.php
Last active March 11, 2023 10:04
Allow SVG usage in WordPress
<?php
// Allow SVG usage in WordPress
function bloggerpilot_cc_mime_types($mimes) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'bloggerpilot_cc_mime_types');