Skip to content

Instantly share code, notes, and snippets.

View seoagentur-hamburg's full-sized avatar

Andreas Hecht seoagentur-hamburg

View GitHub Profile
@seoagentur-hamburg
seoagentur-hamburg / kill-emojis.php
Created June 25, 2017 14:41
Die Emojis ausschalten
<?php
// Ab hier kopieren
//emoji aus dem header entfernen
function ah_disable_emoji_dequeue_script() {
wp_dequeue_script( 'emoji' );
}
add_action( 'wp_print_scripts', 'ah_disable_emoji_dequeue_script', 100 );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
@seoagentur-hamburg
seoagentur-hamburg / wp-embeds-kill.php
Last active July 14, 2021 09:16
Die WordPress-Embed-Funktion komplett ausschalten
<?php
// Ab hier kopieren
/* =============================================================================
### WordPress Embeds ausschalten
============================================================================= */
/**
* Disable embeds on init.
*
* - Removes the needed query vars.
@seoagentur-hamburg
seoagentur-hamburg / .htaccess
Last active March 31, 2024 00:01
UPDATE 2024/03: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.9 - 03/2024
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
[Roter-Button url="https://andreas-hecht.com/" text="Ein cooler Button" klasse="nomargins"]
@seoagentur-hamburg
seoagentur-hamburg / sitemap.php
Last active December 29, 2016 14:09
Erstellt eine sitemap.xml aus eigenen Mitteln ohne Plugin
<?php
/**
* Eine eigene sitemap.xml ohne Plugin erstellen
* @author Andreas Hecht
*/
function ah_create_sitemap() {
$sitemap_posts = get_posts(array(
'numberposts' => -1,
'orderby' => 'modified',
<?php
// Shortcode für den Editor:
[mailcode]
//Für die Template-Dateien Deines Themes:
<?php echo do_shortcode('[mailcode]'); ?>
@seoagentur-hamburg
seoagentur-hamburg / save-email.php
Last active December 27, 2016 15:35
Spam save eMail address with wp shortcode
<?php
//Ab hier kopieren
/**
* Spamsichere E-Mail-Adresse mit WP-Shortcode
* @author Andreas Hecht
* @return E-Mail-Link
*/
function ah_mail_shortcode() {
<?php
// Ab hier kopieren
//WordPress Authentifikation löschen
remove_filter('authenticate', 'wp_authenticate_username_password', 20);
// Neue Authentifikation setzen - Anmelden nur mit E-Mail und Passwort
add_filter('authenticate', function($user, $email, $password){
//Check for empty fields
<form method="get" class="searchform themeform" action="<?php echo home_url('/suchergebnisse/'); ?>">
<div>
<input type="text" class="search" name="q" onblur="if(this.value=='')this.value='<?php _e('To search type and hit enter','hueman'); ?>';" onfocus="if(this.value=='<?php _e('To search type and hit enter','hueman'); ?>')this.value='';" value="<?php _e('To search type and hit enter','hueman'); ?>" />
</div>
</form>
<form method="get" class="searchform themeform" action="<?php echo home_url('/'); ?>">
<div>
<input type="text" class="search" name="s" onblur="if(this.value=='')this.value='<?php _e('To search type and hit enter','hueman'); ?>';" onfocus="if(this.value=='<?php _e('To search type and hit enter','hueman'); ?>')this.value='';" value="<?php _e('To search type and hit enter','hueman'); ?>" />
</div>
</form>