Skip to content

Instantly share code, notes, and snippets.

View glueckpress's full-sized avatar

Caspar Hübinger glueckpress

View GitHub Profile
@Chrico
Chrico / chrico_get_popular_tags_by_category.php
Last active August 29, 2015 14:03
WordPress Dropin: Getting popular Tags by Category
@sergejmueller
sergejmueller / index.html
Created September 9, 2014 08:20
Prevent animation flickering on CSS3 Transitions/Transforms in Safari
<!DOCTYPE html>
<html>
<style>
html {
-webkit-font-smoothing: antialiased;
}
</style>
@bueltge
bueltge / gist:1242366
Created September 26, 2011 14:30
How to use AJAX with WordPress to post and process Javascript
<?php
/*
* Example of how to use AJAX with WordPress to post and process Javascript arrays of objects.
* Drop this in your WordPress theme's functions.php file and it will display the array of objects on page load in the admin
* REF: http://lists.automattic.com/pipermail/wp-hackers/2011-September/040834.html
* By: Mike Schinkel - http://about.me/mikeschinkel
*/
add_action( 'admin_init', 'mytheme_admin_init' );
function mytheme_admin_init() {
wp_enqueue_script('jquery');
@bueltge
bueltge / github-ribbon.html
Created January 27, 2012 10:23
Github Ribbon only with css3
<a id="github" href="https://github.com/bueltge">
<span>Fork me on GitHub!</span>
<span>Get free lemonade!</span>
</a>
@bueltge
bueltge / gist:2304293
Created April 4, 2012 18:01
Remove hierarchy on WordPress Category meta box
add_action( 'add_meta_boxes', 'do_my_meta_boxes' );
function do_my_meta_boxes( $post_type ) {
remove_meta_box( 'my_taxonomydiv', $post_type, 'side' );
add_meta_box( 'my_taxonomydiv', 'My Taxonomy', 'my_meta_box', $post_type, 'side' );
}
function my_meta_box( $post, $meta_box ) {
$taxonomy = 'my_taxonomy';
$tax = get_taxonomy( $taxonomy );
@2ndkauboy
2ndkauboy / _respond-to-ie.scss
Last active October 13, 2015 00:28
A simple mixin that takes a target size and adds a min-width media query and a IE fallback given by a variable for the content.
@mixin respond-to-ie($size){
@if $old-ie {
@content;
} @else {
@media all and (min-width: $size) {
@content;
}
}
}
@sergejmueller
sergejmueller / gist:1213479
Created September 13, 2011 09:27
Prüfung auf ein geladenes und ansprechbares jQuery-Plugin
if ( jQuery.isFunction(jQuery.fn.bxSlider) ) {
$('#slider').bxSlider(
{
...
}
);
}
@sergejmueller
sergejmueller / .htaccess
Last active June 16, 2016 08:34
Stop search engines from indexing .txt, .log, .xml, .css and .js files in Apache
<FilesMatch "\.(txt|log|xml|css|js)$">
Header set X-Robots-Tag "noindex"
</FilesMatch>
@sergejmueller
sergejmueller / goodbye-wordpress.md
Last active July 13, 2016 11:19
Goodbye, WordPress!

Goodbye, WordPress!

Fast 9 Jahre und nahezu 3 Millionen Downloads später ist Schluss.
Schluss mit WordPress.

Für mich geht ein Lebensabschnitt zu Ende. Ein Lebensabschnitt, der unendlich viel Erfahrung, Learnings und Spaß mit sich brachte. Ein Lebensabschnitt, der aber unendlich viel Zeit, Nerven und Motivation mit sich nahm. Doch der Wille zählt und ich hoffe stark, dass meine Software und mein Engagement die WordPress-Community ein Stückchen besser, qualitativer gemacht haben.

// Bitteschön

@joehoyle
joehoyle / private-wp-api.php
Created October 14, 2015 18:37
Only allow access to the API for authenticated requests
<?php
add_filter( 'rest_pre_dispatch', function() {
if ( ! is_user_logged_in() ) {
return new WP_Error( 'not-logged-in', 'API Requests are only supported for authenticated requests', array( 'status' => 401 ) );
}
} );