This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
array_walk($GLOBALS['wp_query']->posts, function($post, $i, $wp_query) { | |
$GLOBALS['post'] = $post; | |
$wp_query->the_post(); | |
// loop code | |
the_title(); | |
the_content(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pr () { | |
git fetch origin refs/pull/$1/head:refs/remotes/origin/pr/$1 --force | |
git checkout -b pr/$1 origin/pr/$1 | |
git rebase master | |
git checkout master | |
git merge pr/$1 --ff-only | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Mfields Github Shortcode | |
Plugin URI: null | |
Description: Display recent commits from a Github repository. | |
Version: 0.1 | |
Author: Michael Fields | |
Author URI: http://wordpress.mfields.org/ | |
License: GPLv2 or later |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adds a hidden input field for scrolltop value. | |
* | |
* @return void | |
*/ | |
function ds_scrollto_input() { | |
$position = ! empty( $_GET['scrollto'] ) ? $_GET['scrollto'] : 0; | |
printf( '<input type="hidden" id="scrollto" name="scrollto" value="%d"/>', esc_attr( $position ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// See http://wordpress.org/extend/plugins/debug-bar/ | |
remove_action( 'admin_bar_menu', array( 'Debug_Bar', 'admin_bar_menu' ), 1000 ); | |
add_action( 'admin_bar_menu', 'ds_fix_debug_bar_menu', 5 ); | |
function ds_fix_debug_bar_menu( $wp_admin_bar ) { | |
$wp_admin_bar->add_menu( array( | |
'parent' => 'top-secondary', | |
'id' => 'debug-bar', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Used where you might want to use an activation function but where it's not convenient or possible (like in a theme.) | |
* Accepts __FILE__ for the a unique key to identify the file. | |
* | |
* @param string $file | |
* @return bool | |
* | |
* Author: Mike Schinkel | |
* Author URI: http://about.me/mikeschinkel/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Junction fixes for plugins | |
Plugin URI: http://interconnectit.com/ | |
Description: Junctioning files into the WordPess plug-ins folder causes problems with php 5.3 for plugin_url, this tries to fix it. Place in the wp-content/mu-plugins folder so it loads before all other plugins. | |
Author: James R Whitehead | |
Version: 0.0.0.0.0.0.2 | |
Author URI: http://interconnectit.com | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Registers the directory "[child-theme-dir]/event-organiser" as a template location for | |
* Event Organiser. EO will look there when looking for the plug-in template files (e.g. single-event.php, archive-event.php, etc ) | |
* | |
*/ | |
function mytheme_register_eventorganiser_stack( $stacks ){ | |
//$stacks is an array of (absolute) directory paths. EO will look in the order | |
//in which they appear in the array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action ( 'wp_head', 'add_jquery_when_comments_in_viewport', 11 ); | |
function add_jquery_when_comments_in_viewport() | |
{ | |
?> | |
<script type="text/javascript"> | |
/* <![CDATA[ */ | |
function jquery_for_comments_onLoad() { | |
var element = document.getElementById( "comments" ), | |
current = document.body.clientHeight+document.body.scrollTop, |
OlderNewer