This file contains 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 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
.ribbon { | |
width: 150px; | |
height: 150px; | |
overflow: hidden; | |
position: absolute; | |
z-index:9; | |
} | |
.ribbon span { | |
position: absolute; |
This file contains 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
<?php ob_start(); | |
header('HTTP/1.1 503 Service Temporarily Unavailable'); | |
header('Status: 503 Service Temporarily Unavailable'); | |
header('Retry-After: 3600'); | |
mail("info@ihredomain", "Datenbankfehler", "Schon wieder die Datenbank!", "From: Meine Website"); | |
?><!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Website nicht erreichbar</title> |
This file contains 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' ); |
This file contains 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
<?php | |
/* | |
Plugin Name: WH Eyecatcher | |
Plugin URI: https://wordpress-handbuch.com/wh-eyecatcher | |
Description: Add a floating slogan to eyery page of your website | |
Version: 1.0.2 | |
Author: WordPress-Handbuch | |
Author URI: https://wordpress-handbuch.com | |
License: GPL v2 or later | |
Copyright 2019 Richard Eisenmenger |
This file contains 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
<?php | |
/** | |
* Plugin Name: WH Custom Post Type | |
*/ | |
function add_wh_events() { | |
$labels = array( | |
'name' => 'Veranstaltungen', | |
'singular_name' => 'Veranstaltung', | |
'add_new' => 'Erstellen', | |
'add_new_item' => 'Neue Veranstaltung erzeugen', |
This file contains 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
<?php | |
/** | |
* @package WH_Hello_World | |
* @version 1.0.0 | |
*/ | |
/* | |
Plugin Name: WH Hello World | |
Plugin URI: https://wordpress-handbuch.com | |
Description: Testausgabe in Front- und Backend | |
Author: Richard Eisenmenger |
This file contains 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
<?php | |
if (is_single()) | |
{ | |
$title = htmlspecialchars( strip_tags( get_the_title( $post->ID ) ) ); | |
$description = htmlspecialchars( strip_tags( get_the_excerpt( $post->ID ) ) ); | |
$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); | |
$image = $thumbnail[0]; | |
$type = 'article'; | |
} elseif (is_page()) { | |
$title = htmlspecialchars( strip_tags( get_the_title( $post->ID ) ) ); |
This file contains 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
AuthUserFile /AbsoluterPfadZumIhremWordPressAdminOrdner/.htpasswd | |
AuthType Basic | |
AuthName "Verhaeltnismaessig geheimer Zugang zur Website" | |
Require valid-user |
This file contains 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
<?php | |
echo 'basename(dirname(__FILE__)) = ' . basename(dirname(__FILE__)) . "<br/>"; | |
echo '$_SERVER["PHP_SELF"] = ' . $_SERVER["PHP_SELF"] . "<br/>"; | |
echo '$_SERVER["DOCUMENT_ROOT"] = ' . $_SERVER["DOCUMENT_ROOT"] . "<br/>"; | |
echo 'dirname(__FILE__) = ' . dirname(__FILE__) . "<br/>"; | |
echo 'getcwd() = ' . getcwd() . "<br/>"; | |
echo '__FILE__ = ' . __FILE__ . "<br/>"; | |
phpinfo(); | |
?> |
NewerOlder