Skip to content

Instantly share code, notes, and snippets.

View glueckpress's full-sized avatar

Caspar Hübinger glueckpress

View GitHub Profile
@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(
{
...
}
);
}
@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 / widget-tut.php
Last active December 8, 2017 03:19 — forked from chrisguitarguy/widget-tut.php
An example of how to build your own WordPress widget
<?php
/*
Plugin Name: FB Widget Tutorial
Plugin URI:
Description: How to create WordPress Widgets.
Version: 13/03/2013
Author: Frank Bültge
Author URI: http://bueltge.de/
License: GPLv3
*/
@sergejmueller
sergejmueller / .htaccess
Created December 21, 2011 14:12
Beispiel einer .htaccess Datei unter WordPress
# Admin absichern
<Files wp-login.php>
AuthName "Admin-Bereich"
AuthType Basic
AuthUserFile /var/www/pfad/.htpasswd
require valid-user
</Files>
# Zugriff verweigern
@bueltge
bueltge / gist:1559249
Created January 4, 2012 09:19
Custom Query Shortcode: Run a Loop inside any Post/Page
<?php
/**
* Plugin Name: Custom Query Shortcode
* Plugin URI:
* Description: Run a Loop inside any Post/Page via Shortcode <code>[loop]</code>
* Version: 0.0.1
* License: GPLv3
* Author: Frank B&uuml;ltge
* Author URI: http://bueltge.de/
*/
@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>
@Rarst
Rarst / r-debug.php
Last active February 3, 2024 17:30
R Debug (set of dump helpers for debug)
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: https://www.rarst.net/
License: MIT
*/
@r-a-y
r-a-y / shortcode.php
Created February 22, 2012 21:01
Check if a shortcode exists in WordPress
<?php
if ( ! function_exists( 'shortcode_exists' ) ) :
/**
* Check if a shortcode is registered in WordPress.
*
* Examples: shortcode_exists( 'caption' ) - will return true.
* shortcode_exists( 'blah' ) - will return false.
*/
function shortcode_exists( $shortcode = false ) {
global $shortcode_tags;
@ocean90
ocean90 / fbcbfwss.php
Last active February 11, 2023 22:03
WordPress Plugin: Filename-based cache busting for scripts/styles.
<?php
/**
* Plugin Name: Filename-based cache busting
* Version: 0.3
* Description: Filename-based cache busting for WordPress scripts/styles.
* Author: Dominik Schilling
* Author URI: https://dominikschilling.de/
* Plugin URI: https://gist.github.com/ocean90/1966227/
*
* License: GPLv2 or later
@luetkemj
luetkemj / wp-query-ref.php
Last active February 6, 2024 14:25
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/