Skip to content

Instantly share code, notes, and snippets.

View bentedder's full-sized avatar

Ben Tedder bentedder

  • Smarsh
  • St Paul, MN
View GitHub Profile
/** Register code custom post type
from http://www.briangardner.com/custom-post-types/
*/
add_action( 'init', 'code_post_type' );
function code_post_type() {
register_post_type( 'code',
array(
'labels' => array(
'name' => __( 'Code' ),
'singular_name' => __( 'Code Snippets' ),
/** Enqueue a custom javascript file in functions.php */
add_action( 'wp_enqueue_scripts', 'bt_add_scripts' );
function bt_add_scripts() {
wp_register_script( 'mystuff', get_bloginfo('stylesheet_directory').'/myscripts.js' );
wp_enqueue_script( 'mystuff' );
}
@bentedder
bentedder / wp-cycle.php
Last active December 11, 2015 22:39
Update of WP-Cycle to include scrollHorz and previous/next buttons
<?php
/*
Plugin Name: WP-Cycle
Plugin URI: http://www.nathanrice.net/plugins/wp-cycle/
Description: This plugin creates an image slideshow from the images you upload using the jQuery Cycle plugin. You can upload/delete images via the administration panel, and display the images in your theme by using the <code>wp_cycle();</code> template tag, which will generate all the necessary HTML for outputting the rotating images.
Version: 0.1.13
Author: Nathan Rice
Author URI: http://www.nathanrice.net/
This plugin inherits the GPL license from it's parent system, WordPress.
@bentedder
bentedder / app.js
Last active August 29, 2015 14:04
basic js pattern (with requirejs)
require(["thing"], function(Thing) {
var thing = new Thing({
place: "Chicago"
});
thing.runAround();
});