Skip to content

Instantly share code, notes, and snippets.

View versluis's full-sized avatar

Jay Versluis versluis

View GitHub Profile
@versluis
versluis / ajax.php
Created June 29, 2012 07:49
How to bring back Post Categories in P2 v1.4
// define $post_cat
$post_cat = $_POST['post_format'];
// and turn it into the category ID
$post_cat = get_category_by_slug( $post_cat );
$post_id = wp_insert_post( array(
'post_author' => $user_id,
'post_title' => $post_title,
'post_content' => $post_content,
'post_type' => 'post',
@versluis
versluis / gist:2994898
Created June 26, 2012 10:30
Caption in WordPress 3.3.2
[caption id="attachment_123" align="aligncenter" width="550" caption="My Caption"]
<img src="...">[/caption]
@versluis
versluis / gist:2994892
Created June 26, 2012 10:28
Caption in WordPress 3.4
[caption id="attachment_123" align="aligncenter" width="550"]
<img src="...">My Caption[/caption]
@versluis
versluis / gist:2950371
Created June 18, 2012 19:56
How to test the state of a UISwitch
if (flickSwitch.isOn ) {
statusLabel.text = @"The Switch is ON";
} else {
statusLabel.text = @"The Switch is OFF";
}
@versluis
versluis / blog.php
Created June 14, 2012 08:35
How to eliminate blog text on the front page of Modularity Lite
<?php
/**
* @package WordPress
* @subpackage Modularity
*/
?>
<div class="span-<?php modularity_sidebar_class(); ?>">
<?php get_sidebar(); ?>
</div>