This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wh_wordpress_backend_custom_logo() { | |
echo ' | |
<style type="text/css"> | |
#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before { | |
background-image: url(' . get_bloginfo( 'stylesheet_directory' ) . '/images/custom-logo.png) !important; | |
background-size: 20px 20px; | |
background-position: 0 0; | |
color:rgba(0, 0, 0, 0); | |
} | |
#wpadminbar #wp-admin-bar-wp-logo.hover > .ab-item .ab-icon { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wh_hide_login_errors(){ | |
return 'No.'; | |
} | |
add_filter( 'login_errors', 'wh_hide_login_errors' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wh_add_login_message( $message ) { | |
return $message . '<h2>Sprich Freund und tritt ein.</h2>'; | |
} | |
add_filter( 'login_message', 'wh_add_login_message' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wh_custom_login_logocss() { | |
echo '<style type="text/css"> | |
.login h1 a { background-image: url(/pfadunddateinamedeslogos.png); background-size: contain; width:315px; } | |
</style>'; | |
} | |
add_action( 'login_head', 'wh_custom_login_logocss' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wh_add_various_mime_types( $mime_types ) { | |
$mime_types['midi'] = 'audio/midi'; | |
$mime_types['psd'] = 'image/vnd.adobe.photoshop'; | |
return $mime_types; | |
} | |
add_filter( 'upload_mimes', 'wh_add_various_mime_types', 1, 1 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wh_set_excerpt_length( $length ) { | |
return 150; | |
} | |
add_filter( 'excerpt_length', 'wh_set_excerpt_length' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wh_change_more_link() { | |
return '<a class="more-link" href="' . get_permalink() . '">Hier weiterlesen...</a>'; | |
} | |
add_filter( 'the_content_more_link', 'wh_change_more_link' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wh_add_social_links( $content ) { | |
$content = preg_replace( '/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/', "$1<a href=\"https://www.instagram.com/$2/\" target=\"_blank\">@$2</a>", $content ); | |
$content = preg_replace( '/([^a-zA-Z0-9-_&])#([0-9a-zA-Z_]+)/', "$1<a href=\"https://www.instagram.com/explore/tags/$2/\" target=\"_blank\">#$2</a>", $content ); | |
return $content; | |
} | |
add_filter( 'the_content', 'wh_add_social_links' ); | |
add_filter( 'comment_text', 'wh_add_social_links' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wh_shortcode_boldanditalics( $attributes, $content ) { | |
// Hier kann beliebiger PHP-Code ausgeführt werden | |
return '<b><i>' . $content . '</i></b>'; | |
} | |
add_shortcode( 'fettkursiv', 'wh_shortcode_boldanditalics' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wh_maintenance_mode() { | |
if ( !is_user_logged_in() || !current_user_can('administrator') ) { | |
wp_die( 'Dritte Variante einer Wartungsseite', 'Wartung!', array( 'response' => '503')); | |
} | |
} | |
add_action( 'get_header', 'wh_maintenance_mode' ); |