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: Placekitten | |
Description: Shortcode [placekitten w=100 h=300 g=1 alt=kitten] and action. | |
Version: 1.0 | |
Author: Thomas Scholz | |
Author URI: http://toscho.de | |
License: GPL | |
*/ |
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 | |
$attachments = get_children( | |
array( | |
'numberposts' => 1, | |
'order'=> 'ASC', | |
'post_mime_type' => 'image', | |
'post_parent' => get_the_ID(), | |
'post_status' => null, | |
'post_type' => 'attachment' |
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
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> |
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_filter( 'sidebars_widgets', 'gmj_shuffle_widgets' ); | |
/** | |
* Shuffle ranges of widgets within a sidebar. | |
* | |
* Hat-tip to {@link http://gmj.to/op} for the original idea. | |
* | |
* @uses gmj_do_shuffle_widgets() Does the actual array manipulation. | |
* |
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
$(function() { | |
$( "#drag-me" ).draggable(); | |
$( "#drop" ).droppable({ | |
drop: function( event, ui ) { | |
$( this ) | |
.addClass( "ui-state-highlight" ) | |
.find( "p" ) | |
$('#counter').html(function(i, val) { | |
return val * 1 + 1 |
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 | |
// test images | |
add_image_size( 'ducks', 350, 350, true ); | |
add_image_size( 'cows', 750, 150, true ); | |
//this function does not work and acts very wacky | |
function add_image_check(){ | |
global $_wp_additional_image_sizes; |
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 | |
// this is handy for debugging live site, out puts page template in footer source code. | |
add_action('wp_footer', 'show_template'); | |
function show_template() { | |
global $template; | |
echo '<!-- the template is:' . $template . '-->'; | |
} |
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
/**********************************************/ | |
/* | |
/* IR_Black Skin by Ben Truyman - 2011 | |
/* | |
/* Based on Todd Werth's IR_Black: | |
/* http://blog.toddwerth.com/entries/2 | |
/* | |
/* Inspired by Darcy Clarke's blog post: | |
/* http://darcyclarke.me/design/skin-your-chrome-inspector/ | |
/* |
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( 'init', 'register_cpt_example' ); | |
function register_cpt_example() { | |
//// Label parameters for the CPT admin | |
$labels = array( | |
'name' => _x( 'Examples', 'example' ), | |
'singular_name' => _x( 'Example', 'example' ), |
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 | |
/** | |
* 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( |