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 / 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:8938408
Created February 11, 2014 16:32
Erstellt eine Breadcrumbs Navigation
<?php
function the_breadcrumb() {
echo '<ul id="crumbs">';
if (!is_home()) {
echo '<li><a href="';
echo get_option('home');
echo '">';
echo 'Home';
echo "</a></li>";
@seoagentur-hamburg
seoagentur-hamburg / one-column-dashboard.php
Created February 13, 2014 13:20
Bringt die Möglichkeit wieder zurück, das WordPress Dashboard einspaltig darzustellen.
<?php
// force one-column dashboard
function shapeSpace_screen_layout_columns($columns) {
$columns['dashboard'] = 1;
return $columns;
}
add_filter('screen_layout_columns', 'shapeSpace_screen_layout_columns');
function shapeSpace_screen_layout_dashboard() { return 1; }
@seoagentur-hamburg
seoagentur-hamburg / dashboard-toolbox.php
Created February 13, 2014 13:28
Bringt das einspaltige Dashboard wieder in WP 3.8 zurück.
<?php
/*
Module Name: Einspaltiges Dasboard
Description: Erstellt die Möglichkeit eines einspaltigen WP-Dashboards [Backend]
Author: Andreas Hecht
Author URI: http://hechtmediaarts.com
*/
/* Sicherheitsabfrage */
if ( !class_exists('Toolbox') ) {
@seoagentur-hamburg
seoagentur-hamburg / gist:9000639
Created February 14, 2014 13:04
.htaccess Code zum Schützen der wichtigen wp-config.php vor Zugriff von außen.
<files wp-config.php>
order allow,deny
deny from all
</files>
@seoagentur-hamburg
seoagentur-hamburg / gist:9001685
Created February 14, 2014 14:15
Verlinkt automatisch alle Twitter-Usernamen im Inhalt und auch im Excerpt, sowie den Kommentaren.<
<?php
function tweetlink($content) {
$tweetlink = preg_replace('/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/',"$1<a href=\"http://twitter.com/$2\" target=\"_blank\" rel=\"nofollow\">@$2</a>",$content);
return $tweetlink;
}
// The content
add_filter('the_content', 'tweetlink');
@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]);
}
/* =Blog-Navigation - Pagination
----------------------------------------------- */
nav.pagination {
position: relative;
display: block;
}
.nav-links {
position: relative;
@seoagentur-hamburg
seoagentur-hamburg / Tweaks wp-config.php
Last active August 29, 2015 14:17
Das Gist zum DrWeb Artikel über die wp-config.php
<?php
/**
* Standardangaben, die sich bereits in der wp-config.php befinden,
* werden nicht berücksichtigt. Nur die zusätzlichen Möglichkeiten.
*
*/
/**
* Automatische Updates abschalten
@seoagentur-hamburg
seoagentur-hamburg / profilangaben.php
Created April 10, 2015 13:26
Wir erweitern die persönlichen Profilangaben von WordPress um einige Felder.
<?php
/**
* Manage WordPress contact fields.
* Usage:
* require './class.TTT_Contactfields.php';
*
* $TTT_Contactfields = new TTT_Contactfields(
* array (
* 'Twitter'
* , 'Facebook'