Skip to content

Instantly share code, notes, and snippets.

@jayj
jayj / gist:1306314
Created October 22, 2011 18:23
Part of tutorial on Jayj.dk
/**
* Format: box
*/
if ( 'box' == $format ) :
$meta = get_post_meta( $id, 'download', true );
$count_meta = get_post_meta( $id, 'download_count', true );
// Start content
ob_start();
@jayj
jayj / gist:1190106
Created September 2, 2011 22:30
Full code for tutorial on Jayj.dk
<?php
/**
* Custom "Download" custom type for tutorial on Jayj.dk
*
* @link http://jayj.dk/2011/download-cpt-wordpress
*/
add_action( 'init', 'jayj_create_download_post_type' );
@jayj
jayj / gist:1189642
Created September 2, 2011 19:33
Custom "Download" metabox for tutorial on Jayj.dk
<?php
/**
* Custom "Download" custom type metabox for tutorial on Jayj.dk
*
* @link http://jayj.dk/
*/
/**
* Adds the download meta box for the download post type
*/
// Register all the javascript and css we need to accompany those scripts
add_action( 'wp_enqueue_scripts', 'html5press_register_scripts' );
add_action( 'wp_print_styles', 'html5press_register_styles' );
function html5press_register_scripts() {
/**
* Modernizr enables HTML5 elements & feature detects
* For optimal performance, use a custom Modernizr build: www.modernizr.com/download/
*/
<?php
/**
* Jayj_I_Make_Themes
*
* Gets the theme readme from WordPress.org.
*
* Modified version of Mark Jaquith's I Make Plugins class
* @link http://wordpress.org/plugins/i-make-plugins/
*/