Skip to content

Instantly share code, notes, and snippets.

Avatar

Andreas Hecht seoagentur-hamburg

View GitHub Profile
View kill-emojis.php
<?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 Aug 18, 2018
Die WordPress-Embed-Funktion komplett ausschalten
View wp-embeds-kill.php
<?php
// Ab hier kopieren
/* =============================================================================
### WordPress Embeds ausschalten
============================================================================= */
/**
* Disable embeds on init.
*
* - Removes the needed query vars.
@seoagentur-hamburg
seoagentur-hamburg / .htaccess
Last active Oct 27, 2020
UPDATE 2020/08: 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.
View .htaccess
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.1 - 08/2020
# ----------------------------------------------------------------------
# @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
########################################################################
View Shortcode-Ausgabe
[Roter-Button url="https://andreas-hecht.com/" text="Ein cooler Button" klasse="nomargins"]
@seoagentur-hamburg
seoagentur-hamburg / sitemap.php
Last active Dec 29, 2016
Erstellt eine sitemap.xml aus eigenen Mitteln ohne Plugin
View sitemap.php
<?php
/**
* Eine eigene sitemap.xml ohne Plugin erstellen
* @author Andreas Hecht
*/
function ah_create_sitemap() {
$sitemap_posts = get_posts(array(
'numberposts' => -1,
'orderby' => 'modified',
View mail-shortcodes.php
<?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 Dec 27, 2016
Spam save eMail address with wp shortcode
View save-email.php
<?php
//Ab hier kopieren
/**
* Spamsichere E-Mail-Adresse mit WP-Shortcode
* @author Andreas Hecht
* @return E-Mail-Link
*/
function ah_mail_shortcode() {
View email-statt-username.php
<?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
View neues-suchformular.php
<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>
View original-suchformular.php
<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>
You can’t perform that action at this time.