Skip to content

Instantly share code, notes, and snippets.

View ancillaryfactory's full-sized avatar

Jon Schwab ancillaryfactory

View GitHub Profile
@ancillaryfactory
ancillaryfactory / addWidget.php
Created March 15, 2012 10:23 — forked from tiffyzsmile/addWidget.php
Wordpress: Add widget area
How to add a widget area to your theme.
<div id="sidebar">
<ul>
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar()) : ?>
<li><!-- stuff shown here in case no widgets active --></li>
<?php endif; ?>
</ul>
</div>
@ancillaryfactory
ancillaryfactory / gist:2033357
Created March 14, 2012 02:02 — forked from luetkemj/wp-query-ref.php
Wordpress: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@ancillaryfactory
ancillaryfactory / gist:1990297
Created March 7, 2012 01:29 — forked from elebescond/gist:1336580
Wordpress: Register admin options
<?php
add_action( 'admin_init', 'myplugin_admin_init' );
function myplugin_admin_init() {
//register settings
register_setting( 'myplugin_options_group1', 'myplugin_option_1' );
}
// create custom plugin settings menu
@ancillaryfactory
ancillaryfactory / .gitignore
Created March 7, 2012 01:24 — forked from redoPop/.gitignore
Wordpress: Template .gitignore file
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@ancillaryfactory
ancillaryfactory / image-shortcode.php
Created March 7, 2012 01:16 — forked from kovshenin/image-shortcode.php
WordPress: Image shortcode for WordPress
<?php
/**
* Image shortcode callback
*
* Enables the [kovshenin_image] shortcode, pseudo-TimThumb but creates resized and cropped image files
* from existing media library entries. Usage:
* [kovshenin_image src="http://example.org/wp-content/uploads/2012/03/image.png" width="100" height="100"]
*
* @uses image_make_intermediate_size
*/
@ancillaryfactory
ancillaryfactory / refresh_css.php
Created January 8, 2012 03:23
Force browser to refresh outdated CSS files
<link rel="stylesheet" href="css/style.css?<?php echo filemtime('css/style.css');?>">