Skip to main content
replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
Source Link

Hi @Jonathan Sampson:

@EAMann is spot-on, Custom Post Types are the way to go.

Here's code you can toss in your theme's functions.php file to implement the Custom Post Type you need (note I included a helper function make_post_type_labels() I like to use that reduces the complexity of defining Custom Post Types):

register_post_type('daily-video', array( 'labels' => make_post_type_labels('Daily Video'), 'public' => true, 'show_ui' => true, 'query_var' => 'daily-video', 'rewrite' => array('slug' => 'daily-videos'), 'hierarchical' => true, 'supports' => array('title','editor', ) ); function make_post_type_labels($singular,$plural=false,$args=array()) { if ($plural===false) $plural = $singular . 's'; elseif ($plural===true) $plural = $singular; $defaults = array( 'name' =>_x($plural,'post type general name'), 'singular_name' =>_x($singular,'post type singular name'), 'add_new' =>_x('Add New',$singular), 'add_new_item' =>__("Add New $singular"), 'edit_item' =>__("Edit $singular"), 'new_item' =>__("New $singular"), 'view_item' =>__("View $singular"), 'search_items' =>__("Search $plural"), 'not_found' =>__("No $plural Found"), 'not_found_in_trash' =>__("No $plural Found in Trash"), 'parent_item_colon' =>'', ); return wp_parse_args($args,$defaults); } 

Also you might find these two answers to be helpful as well:

Hi @Jonathan Sampson:

@EAMann is spot-on, Custom Post Types are the way to go.

Here's code you can toss in your theme's functions.php file to implement the Custom Post Type you need (note I included a helper function make_post_type_labels() I like to use that reduces the complexity of defining Custom Post Types):

register_post_type('daily-video', array( 'labels' => make_post_type_labels('Daily Video'), 'public' => true, 'show_ui' => true, 'query_var' => 'daily-video', 'rewrite' => array('slug' => 'daily-videos'), 'hierarchical' => true, 'supports' => array('title','editor', ) ); function make_post_type_labels($singular,$plural=false,$args=array()) { if ($plural===false) $plural = $singular . 's'; elseif ($plural===true) $plural = $singular; $defaults = array( 'name' =>_x($plural,'post type general name'), 'singular_name' =>_x($singular,'post type singular name'), 'add_new' =>_x('Add New',$singular), 'add_new_item' =>__("Add New $singular"), 'edit_item' =>__("Edit $singular"), 'new_item' =>__("New $singular"), 'view_item' =>__("View $singular"), 'search_items' =>__("Search $plural"), 'not_found' =>__("No $plural Found"), 'not_found_in_trash' =>__("No $plural Found in Trash"), 'parent_item_colon' =>'', ); return wp_parse_args($args,$defaults); } 

Also you might find these two answers to be helpful as well:

Hi @Jonathan Sampson:

@EAMann is spot-on, Custom Post Types are the way to go.

Here's code you can toss in your theme's functions.php file to implement the Custom Post Type you need (note I included a helper function make_post_type_labels() I like to use that reduces the complexity of defining Custom Post Types):

register_post_type('daily-video', array( 'labels' => make_post_type_labels('Daily Video'), 'public' => true, 'show_ui' => true, 'query_var' => 'daily-video', 'rewrite' => array('slug' => 'daily-videos'), 'hierarchical' => true, 'supports' => array('title','editor', ) ); function make_post_type_labels($singular,$plural=false,$args=array()) { if ($plural===false) $plural = $singular . 's'; elseif ($plural===true) $plural = $singular; $defaults = array( 'name' =>_x($plural,'post type general name'), 'singular_name' =>_x($singular,'post type singular name'), 'add_new' =>_x('Add New',$singular), 'add_new_item' =>__("Add New $singular"), 'edit_item' =>__("Edit $singular"), 'new_item' =>__("New $singular"), 'view_item' =>__("View $singular"), 'search_items' =>__("Search $plural"), 'not_found' =>__("No $plural Found"), 'not_found_in_trash' =>__("No $plural Found in Trash"), 'parent_item_colon' =>'', ); return wp_parse_args($args,$defaults); } 

Also you might find these two answers to be helpful as well:

Source Link
MikeSchinkel
  • 37.6k
  • 14
  • 118
  • 132

Hi @Jonathan Sampson:

@EAMann is spot-on, Custom Post Types are the way to go.

Here's code you can toss in your theme's functions.php file to implement the Custom Post Type you need (note I included a helper function make_post_type_labels() I like to use that reduces the complexity of defining Custom Post Types):

register_post_type('daily-video', array( 'labels' => make_post_type_labels('Daily Video'), 'public' => true, 'show_ui' => true, 'query_var' => 'daily-video', 'rewrite' => array('slug' => 'daily-videos'), 'hierarchical' => true, 'supports' => array('title','editor', ) ); function make_post_type_labels($singular,$plural=false,$args=array()) { if ($plural===false) $plural = $singular . 's'; elseif ($plural===true) $plural = $singular; $defaults = array( 'name' =>_x($plural,'post type general name'), 'singular_name' =>_x($singular,'post type singular name'), 'add_new' =>_x('Add New',$singular), 'add_new_item' =>__("Add New $singular"), 'edit_item' =>__("Edit $singular"), 'new_item' =>__("New $singular"), 'view_item' =>__("View $singular"), 'search_items' =>__("Search $plural"), 'not_found' =>__("No $plural Found"), 'not_found_in_trash' =>__("No $plural Found in Trash"), 'parent_item_colon' =>'', ); return wp_parse_args($args,$defaults); } 

Also you might find these two answers to be helpful as well: