Skip to content

Instantly share code, notes, and snippets.

View madysondesigns's full-sized avatar

Sarah Whinnem madysondesigns

View GitHub Profile
@madysondesigns
madysondesigns / gist:3144994
Created July 19, 2012 16:12
Custom taxonomy issues
Currently I have:
localhost/about/jobs - this works, displays list of job posts
localhost/about/jobs/taxonomy - 404 error (even with taxonomy.php)
localhost/about/jobs/job-post-title - works fine
//Custom post type for jobs
function bment_post_type_jobs() {
register_post_type(
'jobs', array(
'labels' => array(
@madysondesigns
madysondesigns / gist:2499962
Created April 26, 2012 14:30
Opengraph thumbnails
In WP functions.php:
function get_post_id() { global $wp_query; $id = $wp_query->post->ID; return $id; }
function opengraph_thumbnail(){
if (is_single()) {
echo get_the_post_thumbnail(get_post_id());
} else {
echo imagedir() ?>/about_better.png <?php ;
}
@madysondesigns
madysondesigns / gist:2171027
Created March 23, 2012 14:16
Photoshop CS^ Crash Log
Process: Adobe Photoshop CS6 [516]
Path: /Applications/Adobe CS6/*/Adobe Photoshop CS6.app/Contents/MacOS/Adobe Photoshop CS6
Identifier: com.adobe.Photoshop
Version: 13.0.0 (20120305.m.415)
Code Type: X86-64 (Native)
Parent Process: launchd [267]
Date/Time: 2012-03-23 10:12:33.059 -0400
OS Version: Mac OS X 10.7.3 (11D50b)
Report Version: 9
@madysondesigns
madysondesigns / gist:1781441
Created February 9, 2012 17:32
Custom post type
Want my newsroom to be url.com/newsroom (currently throws a 404)
Posts should be url.com/newsroom/post-title (currently works)
Code in functions.php:
// newsroom custom content type
function bment_post_type_newsroom() {
register_post_type(
'newsroom', array(
'labels' => array(
@madysondesigns
madysondesigns / gist:1590013
Created January 10, 2012 16:59
Codecademy FizzBuzz
// Add an else statement in case the number is divisible by 5.
// for the numbers 1 through 20,
for (i=1; i<=20; i++) {
// if the number is divisible by 3, write "Fizz"
if ( i % 3 === 0 ) {
// if the number is divisible by 3 and 5, write "FizzBuzz"
if ( i % 5 === 0 ) {
@madysondesigns
madysondesigns / gist:1504420
Created December 21, 2011 03:26
entire theme
<div id="wrapper">
<div id="content"{block:PermalinkPage} class="single"{/block:PermalinkPage}>
{block:IndexPage}<div class="hellyeah">{/block:IndexPage}
{block:Posts}
{block:Photo}
...header and nav..
<div id="wrapper">
<div id="content"{block:PermalinkPage} class="single"{/block:PermalinkPage}>
{block:IndexPage}<div class="hellyeah">{/block:IndexPage}
{block:Posts}