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 / Sharebar.php
Created June 13, 2019 17:15
Statische Share Buttons, die nur die URL und den Titel des Beitrags übermitteln.
<?php
if ( ! function_exists( 'ah_static_share_aside' ) ) :
/**
* Statische Share-Buttons als floating Social Bar an der linken Seite - Facebook, Twitter, Pinterest, Xing und LinkedIn
*
*/
function ah_static_share_aside() {
global $post;
@seoagentur-hamburg
seoagentur-hamburg / disable-responsive-images.php
Created February 18, 2016 15:16
Die Unterstützung für die neuen Responsive Images komplett entfernen.
<?php
/**
* Disable responsive image support
*/
// Clean the up the image from wp_get_attachment_image()
add_filter( 'wp_get_attachment_image_attributes', function( $attr )
{
if( isset( $attr['sizes'] ) )
unset( $attr['sizes'] );
@seoagentur-hamburg
seoagentur-hamburg / css-entfernen.php
Created April 25, 2016 11:05
WordPress: Alle CSS-Dateien entfernen
<?php
function dp_dequeue_unused_styles() {
wp_dequeue_style( "mashsb-styles" );
wp_dequeue_style( "lashare-styles" );
wp_dequeue_style( "mashnet-styles" );
wp_dequeue_style( "banana_content" );
wp_dequeue_script( 'wp-mediaelement' );
wp_dequeue_script( 'mediaelement-and-player.min' );
}
<?php
// Ab hier kopieren
// Ersetzt den WordPress-Feed mit der Feedburner Adresse
function drweb_custom_rss_feed( $output, $feed ) {
if ( strpos( $output, 'comments' ) )
return $output;
/* Link mit deinem persönlichen Feed-Link ersetzen */
return esc_url( 'http://feeds.feedburner.com/drwebmagazin' ); }
@seoagentur-hamburg
seoagentur-hamburg / template-sitemap.php
Last active April 15, 2019 15:23
template-sitemap.php für das Twentyfifteen WordPress-Theme
<?php
/**
* Template Name: Sitemap Template
*/
get_header(); ?>
<section id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
@seoagentur-hamburg
seoagentur-hamburg / gist:8938218
Last active April 15, 2019 15:20
Breadcrumbs als Toolbox-Modul
<?php
/*
Module Name: Breadcrumbs
Description: Erstellt eine Brotkrumen-Navigation [Frontend]
Author: Andreas Hecht
Author URI: http://hechtmediaarts.com
*/
/* Sicherheitsabfrage */
if ( !class_exists('Toolbox') ) {
@seoagentur-hamburg
seoagentur-hamburg / gist:7136323
Created October 24, 2013 12:29
Toolbox-Modul um alles JavaScript in den Footer von WordPress einzubinden.
<?php
/*
Module Name: JavaScript in Footer
Description: Verfrachtet alles JavaScript in den Footer von WordPress [Frontend]
Author: Andreas Hecht
Author URI: http://hechtmediaarts.com/
*/
/* Sicherheitsabfrage */
if ( !class_exists('Toolbox') ) {
@seoagentur-hamburg
seoagentur-hamburg / gist:6257112
Last active April 15, 2019 15:14
Das Toolbox Modul für das Hinzufügen vom Google-Analytics Code zum WordPress Theme
<?php
/*
Module Name: Google Analytics
Description: Hinzufügen vom Google-Analytics Code zum WordPress Theme. [Frontend]
Author: Andreas Hecht
Author URI: http://hechtmediaarts.com
*/
/* Sicherheitsabfrage */
if ( !class_exists('Toolbox') ) {
@seoagentur-hamburg
seoagentur-hamburg / gist:9208817
Last active April 5, 2019 15:54
Ein Plugin aus der WordPress Pluginliste ausblenden.
<?php
function ah_hide_plugin() {
global $wp_list_table;
$hidearr = array('plugin-directory/plugin-file.php'); // plugin-directory/plugin-file.php anpassen
$myplugins = $wp_list_table->items;
foreach ($myplugins as $key => $val) {
if (in_array($key,$hidearr)) {
unset($wp_list_table->items[$key]);
}
@seoagentur-hamburg
seoagentur-hamburg / adsense.php
Created February 24, 2016 17:58
Einen Google-Werbeblock nach dem ersten Absatz eines Artikels einfügen.
<?php
/* =============================================================================
Google-Werbung nach dem ersten Absatz einfuegen
============================================================================= */
add_filter( 'the_content', 'prefix_insert_post_ads' );
function prefix_insert_post_ads( $content ) {