Skip to content

Instantly share code, notes, and snippets.

@pixelstrolch
pixelstrolch / bilder-geladen.js
Created Jan 22, 2014
Überprüft ob Bilder geladen wurden. Benötigt jQuery
View bilder-geladen.js
$(‘img’).load(function() {
console.log(‘image load successful’);
});
@pixelstrolch
pixelstrolch / wp_auto_twitter_links.php
Last active Jan 3, 2016
Automatische Verlinkung von Twitter-Benutzernamen.
View wp_auto_twitter_links.php
@pixelstrolch
pixelstrolch / Deaktiviere WP Galerie head styles
Created Dec 27, 2013
Styling von WordPress-Galerien über die functions.php ausschalten
View Deaktiviere WP Galerie head styles
add_filter( 'use_default_gallery_style', '__return_false' );
@pixelstrolch
pixelstrolch / excerpt_readmore.php
Last active Dec 26, 2015
Custom excerpt read more link
View excerpt_readmore.php
<?php function excerpt_readmore($more) {
return '... <a href="'. get_permalink($post->ID) . '" class="readmore">' . 'Read More' . '</a>';
}
add_filter('excerpt_more', 'excerpt_readmore'); ?>
@pixelstrolch
pixelstrolch / moving_wordpress
Created Jun 13, 2013
Moving WordPress: 1. Replacing WordPress’ base URL path. 2. Update the GUID that controls WordPress’ translating paths and post locations. 3. Update the URL paths in the content. 4. Update the URLs in the meta data of posts, such as attachments.
View moving_wordpress
UPDATE wp_options SET option_value = replace(option_value, 'http://localhost:8888/wordpress', 'http://www.YOUR_SITE_URL.com') WHERE option_name = 'home' OR option_name = 'siteurl';
@pixelstrolch
pixelstrolch / change_login_logo.php
Created Nov 30, 2012
Ersetze das WordPress Logo auf der Login-Seite mit deinem eigenem Logo.
View change_login_logo.php
function custom_login_logo() {
echo
'<style type="text/css">
h1 a {
background-image:url('.get_site_url().'/wp-content/uploads/login.png) !important;
background-size: 100% auto !important;
margin-left: 8px !important;
width: 312px !important;
}
</style>';
View disable-wp-backend-editors.php
/*
* Files Editoren abschalten
*/
define('DISALLOW_FILE_EDIT',true);
View wp_head_cleanup.php
<?php
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'wp_generator' );
remove_action( 'wp_head', 'start_post_rel_link' );
remove_action( 'wp_head', 'index_rel_link' );
remove_action( 'wp_head', 'adjacent_posts_rel_link' );
remove_action( 'wp_head', 'wp_shortlink_wp_head' );
?>
View wp_images_crop_dont_scale.php
<?php
// Standard Size Thumbnail
if(false === get_option("thumbnail_crop")) {
add_option("thumbnail_crop", "1"); }
else {
update_option("thumbnail_crop", "1");
}
// Medium Size Thumbnail
if(false === get_option("medium_crop")) {
View wp_spam_long_url.php
<?php
function url_spamcheck( $approved , $commentdata ) {
return ( strlen( $commentdata['comment_author_url'] ) > 50 ) ? 'spam' : $approved;
}
add_filter( 'pre_comment_approved', 'url_spamcheck', 99, 2 );
?>