Skip to content

Instantly share code, notes, and snippets.

View franz-josef-kaiser's full-sized avatar

Franz Josef Kaiser franz-josef-kaiser

View GitHub Profile
@franz-josef-kaiser
franz-josef-kaiser / shortcodes.txt
Last active November 2, 2018 19:52
Fake Shortcodes for Google+
MarkUp (parsed)
*bold*
_italic_
-strikethrough-
Special Characters:
OE Œ œ
AE Æ æ
Arrows:
@franz-josef-kaiser
franz-josef-kaiser / the_excerpt.php
Created November 26, 2011 18:44
Wordpress: Use excerpt with content as fallback (one-liner shorthand)
print apply_filters( 'the_excerpt', get_the_excerpt() XOR get_the_content('') );
@franz-josef-kaiser
franz-josef-kaiser / textdomain.php
Created November 29, 2011 14:53
Load Textdomain for plugin/mu-plugin/theme
<?php
class oxoTextDomainLoader
{
/**
* Load plugin translation
*
* @link http://wordpress.stackexchange.com/questions/33312/how-to-translate-plural-forms-for-themes-plugins-with-poedit/33314#33314 Translation Tutorial by the author
* @since 3.0
* @return void
@franz-josef-kaiser
franz-josef-kaiser / onload.init.js
Created January 16, 2012 16:03
Window onLoad triggers for all browsers
/**
* Window onLoad Init triggers
* Use to load all functions you need on window.onload w/o the need for jQuery
*
* @author Dean Edwards/Matthias Miller/John Resig
* @link http://stackoverflow.com/a/3144510/376483
*/
function init()
{
// quit if this function has already been called
@franz-josef-kaiser
franz-josef-kaiser / mobile_meta.php
Last active September 29, 2015 17:38
Mobile Meta
<?php
/**
* Mobile Support
*
* @since 0.1
* @return (string) $output For mobile devices like iPhone
*/
function oxo_add_chrome_meta()
{
$output = '';
@franz-josef-kaiser
franz-josef-kaiser / container_data.php
Created February 10, 2012 13:07
Get container data from whatever container a file is in
<?php
/**
* A: Sets the {$_data} of the base 'theme' / 'plugin' / 'mu-plugin'
* B: Fills the {$_container} variable with the type of container
*
* Performance: average loading time on a local (not vanilla) install,
* inside a theme directory, for 10.000 runs: 0.0042 sec.
* The perfomance on a vanilla install should be even better.
*
* In case someone used `register_theme_directory()` to add additional
@franz-josef-kaiser
franz-josef-kaiser / image-sizes-extd.php
Last active January 24, 2017 18:29
Altering & handling default and custom wordpress image sizes and related stuff
<?php
defined( 'ABSPATH' ) OR exit;
add_action( 'init', array( 'oxoImageSizesExtd', 'init' ), 0 );
class oxoImageSizesExtd extends oxoImageSizes
{
/**
* The Class Object
* @var
@franz-josef-kaiser
franz-josef-kaiser / deprecated.md
Last active October 1, 2015 01:07
is_ssl() for most cases - mu-plugin

Deprecated

For a Replacement visit this project on our GitHub organisation account.

@franz-josef-kaiser
franz-josef-kaiser / image-shortcode.php
Created March 9, 2012 12:20 — forked from kovshenin/image-shortcode.php
Image shortcode & template tag for WordPress - mu-plugin
// THIS GIST HAS MOVED TO A REPO: https://github.com/franz-josef-kaiser/Dynamic-Image-Resize
@franz-josef-kaiser
franz-josef-kaiser / alternate_themes_dir.php
Created March 9, 2012 17:18
Change WP Directory Names
<?php
/**
* Plugin Name: Alternatives Themes Dir
* Plugin URI: http://unserkaiser.com
* Description: Changes the themes directory to <code>/apps</code>
* Version: 0.1
* Author: Franz Josef Kaiser
* Author URI: http://unserkaiser.com
*/
// Prevent loading this file directly - Busted!