You are reading
Post Not Found
Sorry, but you are looking for something that isn't here.
=== Portico === Contributors: danbettles Donate link: http://danbettles.net/ Tags: custom post type, custom post types, content type, content types, custom type, custom types, cms, wordpress 3, php 5.3, phpunit, custom posttype, custom posttypes, contenttype, contenttypes Requires at least: 3.0 Tested up to: 3.5.1 Stable tag: 1.0.2 Portico makes defining and administering custom post-types EASY. Define your post-type in a class, and an admin interface will be created for you. == Description == = Overview = There are just two steps to implementing a custom post-type with Portico. Here's a quick overview before we get down to the coding required. * Declare a class that defines your custom post type. * Create a display template for the new post type. That's it! Portico handles the rest for you, and that includes building an admin interface for working with posts of the new type. = Coding = Let's take a look at a simple example, the implementation of a Podcast post-type. Here's what the custom post-type's definition looks like: `addCustomField('artist', 'Artist', array( 'mandatory' => true, )); //Default values can also be applied to text fields $this->addCustomField('genre', 'Genre', array( 'values' => array( 'Ambient' => 'Ambient', "Drum 'n' Bass" => "Drum 'n' Bass", 'Dubstep' => 'Dubstep', ), 'default' => "Drum 'n' Bass", )); //Set "length" to NULL to get a textarea $this->addCustomField('trackList', 'Track List', array( 'length' => null, )); } } ?>` Put the code in `functions.php` - or in a separate file *include*d by `functions.php` - in your theme. The next time you visit the WordPress admin area you should see a "Podcasts" section in the left-hand menu, beneath the usual "Posts" and "Pages" links. Take a look at the first screenshot to see exactly what you can expect. All that remains is to create a custom display-template so we can view the values of a podcast's custom fields. You can start by making a copy of `single.php` and renaming it after your custom post-type. Here's the template for the Podcast type, based on `single.php` shipped with the Modern Clix 1 theme: `
Sorry, but you are looking for something that isn't here.