Rock-Solid WordPress 3.0 Themes using Custom Post Types

Rock-Solid WordPress 3.0 Themes using Custom Post Types

Tutorial Details
  • Technology: WordPress
  • Topic: Custom Post Types
  • Difficulty: Moderate

The WordPress community is buzzing with excitement over the soon-to-be-released WordPress 3.0. Currently in Beta 2 now, WordPress 3.0 will have a lot of exciting new features , such as a new default theme and better menu management. Quite possibly the most exciting of these features is custom post types. In this tutorial, we’ll talk about creating and using custom post types to make a rock-solid theme.


What is a Custom Post Type?

Well, according to the WordPress Codex:

“Post type refers to the various structured data that is maintained in the WordPress posts table. Custom post types allow users to easily create and manage such things as portfolios, projects, video libraries, podcasts, quotes, chats, and whatever a user or developer can imagine.”

Essentially, it allows us developers to make new kinds of posts similar to the post and page types, which all appear in the main navigation in the WordPress admin. There are several advantages to this; most notably, we no longer need plugins to create special types, we can build a theme that relies less on custom fields (as we know them), and they make managing the site easier for clients and non-technical users. Instead of telling them to create a “post” and make sure to fill in all kinds of custom fields for say, music, we can simply tell them to click “Music” to add a new music post.

Let’s Get Started!

In this tutorial we will:

  • Create a Custom Post Type for Products with our own inputs
  • Create a custom “taxonomy” for the type.
  • Create a theme template to go along with the new type.

Register the Custom Post Type

All of this will be done from within our theme’s functions.php file. I’m modifying the default 3.0 theme, TwentyTen.

The first thing we will do is tell WordPress that we want to register a new custom type. Here’s the code:

	add_action('init', 'product_register');
	
	function product_register() {
    	$args = array(
        	'label' => __('Products'),
        	'singular_label' => __('Product'),
        	'public' => true,
        	'show_ui' => true,
        	'capability_type' => 'post',
        	'hierarchical' => false,
        	'rewrite' => true,
        	'supports' => array('title', 'editor', 'thumbnail')
        );

    	register_post_type( 'product' , $args );
	}

The first line is a hook to tell WordPress that we want to call the function product_register() during initialization. It’s in that function that we register the new post type.

The function register_post_type() accepts two arguments: the name we want to give our post type, and a list of arguments used to create that post type, which we put in an array called $args. You can read exactly what all of the arguments are here, but I want to point out the important ones.

  • label & singular_label: These are the labels as we want them to appear in the WordPress admin. ‘label’ will show up in the admin nav and anywhere that references multiple entries of that type (Edit Products, for example). ‘singular_label’ will show up when one of that type is referenced (Add Product, for example).
  • capability_type: This tells WordPress which native type (post, page, attachment, revision, or nav-menu-item) the custom type will behave as. By making it a ‘post’ type, we can do things like add it to a category.
  • rewrite: Tell WordPress if (or how) to apply permalinks formatting. You can send a boolean as we did, or any array of arguments to apply a custom permalink format to the type.
  • supports: This is everything on the add/edit page that will show up. We want to have a title, editor(the content), and thumbnail images. Next, we will add our own custom inputs by cleverly masking custom fields as input fields for our custom type.

Adding Our Own Inputs

Let’s add our own custom inputs for our new type. Since we can now create new post types, we can make the custom fields more streamlined for users that might not be as familiar with WordPress as we are. It’s worth noting here that this functionality has been available since 2.5 and up until this point, has been used primarily by plugin developers. Here we are going to add a price field.

<?php
	add_action("admin_init", "admin_init");
	add_action('save_post', 'save_price');

	function admin_init(){
		add_meta_box("prodInfo-meta", "Product Options", "meta_options", "product", "side", "low");
	}
	
	
	function meta_options(){
		global $post;
		$custom = get_post_custom($post->ID);
		$price = $custom["price"][0];
?>
	<label>Price:</label><input name="price" value="<?php echo $price; ?>" />
<?php
	}
function save_price(){
	global $post;
	update_post_meta($post->ID, "price", $_POST["price"]);
}
?>

Once again, the first couple of lines are hooks to tell WordPress when we want to use certain functions. The first line says that when the admin panel is initialized, call the function that we wrote, admin_init(). This function tells WordPress to add an area called “Product Options” to any posts of type ‘product’, and to use the function meta_options() to print the form fields. You can read more about add_meta_box here. meta_options() will then get any preexisting custom values and print the form field. The second action line states that when a post is saved, call our function save_price(), which uses update_post_meta() to add or update a custom field called ‘price’.


Custom Categories and Edit Columns

Our last step in creating a completely custom type is giving unique names to its category and edit column labels. First, the custom category name, or ‘taxonomy’.

register_taxonomy("catalog", array("product"), array("hierarchical" => true, "label" => "Catalogs", "singular_label" => "Catalog", "rewrite" => true));

The function we use is register_taxonomy(), which you can find in the codex here; it has been available since 2.8. It’s essentially saying that we want to create a new category type called ‘catalog’ which we will associate with the ‘product’ type. The last argument is an array of information similar to what we saw the register_post_type() function. When all is said and done, we will have the term ‘Catalog’ appear beneath our Products menu in the WordPress admin and it will behave like Post Categories do.

Next, we want to create a custom set of columns for our Product type.

add_filter("manage_edit-product_columns", "prod_edit_columns");
add_action("manage_posts_custom_column",  "prod_custom_columns");
function prod_edit_columns($columns){
		$columns = array(
			"cb" => "<input type=\"checkbox\" />",
			"title" => "Product Title",
			"description" => "Description",
			"price" => "Price",
			"catalog" => "Catalog",
		);
		
		return $columns;
}

function prod_custom_columns($column){
		global $post;
		switch ($column)
		{
			case "description":
				the_excerpt();
				break;
			case "price":
				$custom = get_post_custom();
				echo $custom["price"][0];
				break;
			case "catalog":
				echo get_the_term_list($post->ID, 'catalog', '', ', ',''); 
				break;
		}
}

The first two lines are hooks to tell WordPress that we want custom columns for the ‘product’ type. The first line says that when printing columns for the product type, use the ones defined in the function prod_edit_columns().

In prod_edit_columns(), we have a key-value array where the keys are used to reference certain post information, which we define in the second function, prod_custom_columns(). The values in that array are the column headings. You might notice that prod_edit_columns() lists five columns, but we only describe display information for three in prod_custom_columns(). ‘cb’ and ‘title’ are part of a set of default keys that WordPress already has associations for. WordPress doesn’t know what the other three are, so it’s up to us to define them.


Making the Theme Template

Not too shabby, right? And now we are finally up to the fun part- the theme template. To make a theme template for a custom post type, we simply name the template single-<post-type-slug>.php and add it to our theme. In our case, this would be single-product.php. Here I will show you a snippet of that page that displays all of the information we’ve added to our custom post type:

<?php the_post(); ?>
				
<?php
	$custom = get_post_custom($post->ID);
	$price = "$". $custom["price"][0];

?>

<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h1 class="entry-title"><?php the_title(); ?> - <?=$price?></h1>

<div class="entry-meta">
	
	<div class="entry-content">
		<?php the_post_thumbnail(); ?>
		<?php the_content(); ?>
	</div>
</div>

I’ve added this code to the Twentyten theme in WordPress 3.0 Beta, as it’s the only theme that supports the new functionality- namely the menu system. I copied the single.php template, renamed it single-product.php and replaced everything in the ‘content’ div with the code above. To test my code, I went to Themes->Menus and added our new type to my site’s navigation. Then, I clicked through to our custom post type.


Wrapping Up

As I said previously, WordPress 3.0 is still in beta (you can get it here); so there are still some bugs to work out and some things may change in the final version. The best thing you can do is get in there and play with some of the new features to familiarize yourself with the updates/changes. From what I’ve seen so far, things are looking pretty good!

Joe Casabona is jcasabona on Codecanyon
Tags: Wordpress
Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://deutsch.karinslaughter.net/ Accourotrut

    I am new here and thought I`d say hi.

    Really have got to point out, the idea definitely is seriously fascinating in this case.

    Accourotrut
    alias
    Ricky L,

  • http://hackforums.net Electrixeur1Ðá1

    Hey guys! Today i found this awesome PTC site! Minimal payout is 10c only! Be quick and make some extra dollars! http://bit.ly/bBPKOW

  • http://www.katexs.com theatarddak

    uruly forced me to do so thanks truly sually i do not post on blogs but i would love to say that this blog

  • Bob

    Where are you suggesting to paste the code for “Adding Our Own Inputs?” You can’t past that into the functions.php file, it crashes the entire site if you do.

    • Charley

      Yes, where is this code supposed to go? It’s breaks the site if you put it in functions.php.

      “All of this will be done from within our theme’s functions.php file.”

      • Bob

        Yeah I can register new custom posts no problem, but they have php nested inside of html nested inside of php for the custom input, how on earth is that suppose to work?

      • Kooka

        add_action(“admin_init”, “admin_init”);
        add_action(‘save_post’, ‘save_price’);

        function admin_init(){
        add_meta_box(“prodInfo-meta”, “Product Options”, “meta_options”, “product”, “side”, “low”);
        }

        function meta_options(){
        global $post;
        $custom = get_post_custom($post->ID);
        $price = $custom["price"][0];

        echo ‘Price:’;

        }

        function save_price(){
        global $post;
        update_post_meta($post->ID, “price”, $_POST["price"]);
        }

      • http://charleyramm.co.uk Charley

        I think they made a mistake in showing opening and closing php tags in the middle of functions.php. It actually seems to be a problem with their code highlighter – they are not there if you click ‘copy code to clipboard.

        My functions.php currently looks like this. It’s a bit copy/paste influenced, but maybe you will find it useful. :

        _x(‘Jewellery’, ‘post type general name’),
        ‘singular_name’ => _x(‘Jewellery’, ‘post type singular name’),
        ‘add_new’ => _x(‘Add New’, ‘jewellery’),
        ‘add_new_item’ => __(‘Add New Jewellery’),
        ‘edit_item’ => __(‘Edit Jewellery’),
        ‘new_item’ => __(‘New Jewellery’),
        ‘view_item’ => __(‘View Jewellery’),
        ‘search_items’ => __(‘Search Jewellery’),
        ‘not_found’ => __(‘No jewellery found’),
        ‘not_found_in_trash’ => __(‘No jewellery found in Trash’),
        ‘parent_item_colon’ => ”
        );
        $args=array(
        ‘labels’ => $labels,
        ‘public’ => true,
        ‘publicly_queryable’ => true,
        ‘show_ui’ => true,
        ‘query_var’ => true,
        ‘rewrite’ => true,
        ‘capability_type’ => ‘post’,
        ‘hierarchical’ => false,
        ‘menu_position’ => null,
        ‘supports’ => array(‘title’, ‘thumbnail’)
        );
        register_post_type(‘jewellery’, $args);
        }

        // Add custom post type fields: Jewellery – Item Code, Size, Description/Material, Price

        add_action(“admin_init”, “admin_init”);
        function admin_init(){
        add_meta_box(“prodInfo-meta”, “Product Options”, “meta_options”, “jewellery”, “side”, “low”);
        }

        add_action( ‘save_post’, ‘save_price’);

        function meta_options(){
        global $post;
        $custom = get_post_custom($post->ID);
        $code = $custom["code"][0];
        $size = $custom["size"][0];
        $material = $custom["material"][0];
        $price = $custom["price"][0];
        ?>
        Code:<input name="code" value="” />
        Size:<input name="size" value="” />
        Material/Description:<input name="material" value="” />
        Price:<input name="price" value="” />
        ID, “code”, $_POST["code"]);
        update_post_meta($post->ID, “size”, $_POST["size"]);
        update_post_meta($post->ID, “material”, $_POST["material"]);
        update_post_meta($post->ID, “price”, $_POST["price"]);
        }

        // Custom Taxonomy Jewellery
        add_action(‘init’, ‘jewellery_taxonomy’, 0);
        function jewellery_taxonomy(){
        register_taxonomy( ‘jewellery’, ‘jewellery’, array( ‘hierarchical’ => true, ‘label’ => ‘Categories’, ‘query_var’ => true, ‘rewrite’ => true ) );
        }

      • Charley

        Sorry. Nettuts is murdering my < / >’s.

  • http://ebooki.comeze.com kachnamza

    I’m glad to meet you all! Have a nice day

    • arnold

      omg your scaring us

  • Ajith

    Thank you for this awesome tutorial; I have been looking for…

  • http://www.simplethemes.com Casey

    This is by far the best Custom Post Type tutorial I’ve come across. Thanks so much.

  • http://www.verticaljumpcenter.com/ Andre

    Thanks for the post! It was really usefull.

  • Kooka

    Sorry for the one before…

    add_action(“admin_init”, “admin_init”);
    add_action(‘save_post’, ‘save_price’);

    function admin_init(){
    add_meta_box(“prodInfo-meta”, “Product Options”, “meta_options”, “product”, “side”, “low”);
    }

    function meta_options(){
    global $post;
    $custom = get_post_custom($post->ID);
    $price = $custom["price"][0];

    echo ‘<label>Price:</label><input name=”price” value=”‘ . $price . ‘” />’;

    }

    function save_price(){
    global $post;
    update_post_meta($post->ID, “price”, $_POST["price"]);
    }

    • Alan

      That is the exact same thing that is in the tutorial and still breaks the entire site.

      • revive

        this should work fine.. here is the exact code copied from my functions.php file, and its working right now with it.. hope this helps. If yours still does not work, it might be something else in your functions.php file ;)

        add_action(‘init’, ‘product_register’);

        function product_register() {
        $args = array(
        ‘label’ => __(‘Products’),
        ‘singular_label’ => __(‘Product’),
        ‘public’ => true,
        ‘show_ui’ => true,
        ‘capability_type’ => ‘post’,
        ‘hierarchical’ => false,
        ‘rewrite’ => true,
        ‘supports’ => array(‘title’, ‘editor’, ‘thumbnail’)
        );

        register_post_type( ‘product’ , $args );
        }
        add_action(“admin_init”, “admin_init”);
        add_action(‘save_post’, ‘save_price’);

        function admin_init(){
        add_meta_box(“prodInfo-meta”, “Product Options”, “meta_options”, “product”, “side”, “low”);
        }

        function meta_options(){
        global $post;
        $custom = get_post_custom($post->ID);
        $price = $custom["price"][0];
        echo ‘<label>Price:</label><input type=”text” name=”price” value=”‘. $price .’” />’;
        }

        function save_price(){
        global $post;
        update_post_meta($post->ID, “price”, $_POST["price"]);
        }
        // custom table columns
        register_taxonomy(“catalog”, array(“product”), array(“hierarchical” => true, “label” => “Catalogs”, “singular_label” => “Catalog”, “rewrite” => true));

      • revive

        BTW, when you copy code from the comments here.. you have to replace the ‘ and ’ with apostrophes ‘ .. !! Or it WILL break your site.. so, just search and replace each individually.. and that should help. Also, of note, I added the correct attribute to the Text field.. so that WordPress knows it is in fact a type=”text” field.. and formats it correctly. ;)

  • http://www.stanohek.ru/index.php/about/ Fleeclags

    I like your forum will be happy to take part in obsuzhdeniyah.spasibo.

  • http://www.duycom.com duycompc

    we do computer and notebook repair in turkey. ( bilgisayar ve notebook tamiri solar panel ) Our projects are related to solar panels and power led lighting. if you visit our site; http://www.duycom.com/ thanks for your rep :)

    • Kim

      WTF?

  • http://notebookbagsbest.wikispaces.com/Choosing+the+Incomparable+Laptop+Example+ enhanyHeloaky

    What’s up, I’m enhanyHeloaky from Canada
    Happy to become member of this community

  • matt

    Ok I am sick and tired of these half baked custom post articles that are so f***ing vague. Do you people not read the comments? WHERE DO YOU PUT THIS CODE IN THE FUNCTIONS FILE? I have had nothing but problems with this code and I signed up for a stupid premium account to get access to the source files which don don don don … doesn’t exist… can you please post the code IN ITS ENTIRETY within the file or please post it in the members section so that we may see the magic in which this works.

    • revive

      Hey Matt.. check my comment a couple replies above.. you have to replace the ‘ and ’ with apostrophe’s.. it’s just how this site formats code in comments.. which is LAME.. but, it does.. lol.

      I’ve also pasted the code, with corrected text field.. here:
      http://pastie.org/1266285

      And I can’t agree with you more.. coming from other CMS’s to WP over the last year or so, there seems to be a plethora of articles that cover the same stuff and it’s mostly superficial. This article would be great if it had a 1, 2 and 3 layout for creating the panel for the new Post Type, then adding fields to that post type and then parsing those fields to the template.. or something along those lines..

      • http://webface.pl agabu

        Thank you @revive for the link to your code. I’ve copy-pasted it and works great.

        Thank you @Joe fot the great tutorial. This is the best of tutorials I’ve read recently. Great work!

      • http://webfaces.pl agabu

        [once again, I put the wrong URL previously]

        Thank you @revive for the link to your code. I’ve copy-pasted it and works great.

        Thank you @Joe fot the great tutorial. This is the best of tutorials I’ve read recently. Great work!

  • Luis Rivera

    What will we do without Net.Tuts+….

    Thank’s 4 the envato team and contributors!

  • http://www.creativeworld.com.au/ Leon Poole

    This tutorial is great, but don’t you need to create/register a taxonomy table in your WordPress database to store the custom term taxonomy??

  • Luis Rivera

    Hi,

    It’s a pain when you get a tutorial that has almost the 100% of what you’r looking for! =)
    That one helped me a lot, but im sure everybody will love if you give it an upgrade explaining others examples like “Adding images and others attachmetns field’s to our custom post”

    In my situation, i need exactly this, because i will like my cliente to have the a field for the price, maybe one for pdf, and something like a little slideshow of images for the product.

    Please! i need the solution

  • http://www.sandacreative.com Anoop D

    Simply awesome …..!!! What else to say …..? Let Nettuts continue its great run … thanks a thousand times

  • Mike

    Wonderful! Another inettuts entry that is vague and doesnt work properly!

    • Alan

      Some of it will work, the custom input fields do not however.

  • http://www.bestgoogletrends.info/ Reda Amundson

    Hallo Friend , i like w/ Your posting. i will come to your blog again tomorrow

  • http://www.devotionmagazine.se Andreas.

    Too bad it’s not possible to use Custom Post Types along with Sticky Posts. The sticky post option is not possible when posting with custom post types.

  • http://www.reishanbilgisayar.com/ reishanwebb

    Thats good idea, i agree with you about this subject. Maybe after see own job. Reishan Web Design, Web Software, php, asp, dot .net, sql, all in one software

  • http://biolokacia.do.am vasilievvladislav
  • http://curt.dp.ua Curtdp

    Does anybody know, how to create “Related Posts” for custom types in WordPress?

  • http://alexjsmith.com Alex

    I don’t see why wordpress did not make this part of the Admin GUI.

    Someone made a plug-in that does all of this. I have not tested it but since there is so much in the comments about this tutorial being bad I figured I should post this here.

    http://www.wpeasyposttypes.com/

    • http://alexjsmith.com Alex

      I have tested it and it seems to work pretty well. It doe snot do attachments or anything but you can just use the media uploader like normal and copy and past the file location.

  • http://garethpoole.com Gareth Poole

    Awesome stuff; Im putting together a proposal to move from in house CMS to WordPress and custom content types are exactly what I was looking for in 3.0

  • http://dereckbester.co.za/ Dereck Bester

    Thanks for this post.

    Busy working on a website for photography where I also have to use Custom Post Types, and I must say this post helped me so much.

    Thank you and hope we’ll see more posts like this one.

    Dereck Bester

  • Caden

    Hello

    This code seems to not be working.. the price field keeps resetting randomly every once in awhile. I’ll leave the page and come back and the price field is empty once I’ve set it and saved it. It will stay there for awhile and be listed when I click edit the item. But then after I come back a few times the price value just disappears….

    What could be causing this? Is this an error in the code because I copied and pasted it directly?

  • http://www.techbrij.com Brij

    Nice Post!!!

    I have created a project collection theme based on this custom post type feature.

    See following to download:

    http://www.techbrij.com/342/create-project-collection-theme-wordpress-3-custom-post-type

  • http://www.usedbook.sg used-book

    i can always find amazing knowledge at ur website. thanks dude, and keep it going!

    cheers,

  • mubashar

    Hello every body,
    this tutorial is awesome and help me a lot in create custom post type but i am getting problem i am using thesis theme and i can not find the front end file for custom post type. I custom post type categories and showed on front end but category link giving page not found error. It made link like http://www.example.com/business/test and gave page not found error. any idea how i get rid from this. please help me urget.
    help will apperciated.

    Thanks to all

    Awara

  • shane

    You know it’s very good that WordPress can do this but Drupal is way ahead in that you can create custom node types with CCK very easily without all this manual editing/input and having to adjust the theme. Hopefully WordPress will one day eventually catch up to Drupal. Does anyone know if this will be built into WordPress admin without having to touch the theme files?

  • http://mama-tour.blogspot.com/ MaMa

    Thanks for the post

    Hello.
    Guide
    Attractions

    Tour Pattaya, Pattaya Nightlife
    Pattaya+Nightlife
    Bar, beer, entertainment disco, lady boys show cabaret pubs and live music outdoors at the famous Walking Street is known Nightlife.

  • http://iwannabeadesigner.wordpress.com Bruno
  • http://www.hovlandur.net Hovlandur

    Gotta say, you guys got alot of good tutorials!

  • http://www.restaurangbloggen.se Kim

    Thanks for the nice tutorial.

  • larf2k

    I know this is an older post, but I had a question about the filter and action for adding custom columns to the post/page/custom post_type management page.

    I am able to add custom column in the post manager for my custom post-type, but in this particular post type, I’ve removed support for a title, as it’s simple an image upload and some meta-data. In the post management screen, I want to unset the ['title'] entry as it will always be “Auto Draft”, but I’ve noticed if I do that, the rollover effect built in to wordpress on the title column goes away too (where “Edit”, “Draft”, “Trash”, etc are revealed). This presents the user experience problem of not being able to easily edit the post that you are hovering over.

    Can I specify which columns behave the way the title column behaves? I fear that that is the only column that holds that functionality without hacking the core.

  • SteveCrafty

    I know it’s a while back that you posted, but this is for Caden or anyone else regarding the following problem: “…the price field keeps resetting randomly every once in awhile”.

    I’m still a noob with this, but I *think* this is due to autosave. If you read through the following page it explains what to do regarding autosave:

    http://codex.wordpress.org/Function_Reference/add_meta_box

    • gaspar

      When fiels are erased it’s because “autosave” dont get the field values.

      I put this

      if ( defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE ) {
      return $post_id;
      }

      inside the function to saveteh fields, and it work for me

      function save_details($post_id){
      global $post;

      if ( defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE ) {
      return $post_id;
      }
      if( $post->post_type == “centros” ) {
      if( isset($_POST['morada']) ) { update_post_meta( $post->ID, ‘Localização’, $_POST['morada'] );}
      if( isset($_POST['morada2']) ) { update_post_meta( $post->ID, ‘Morada’, $_POST['morada2'] );}
      if( isset($_POST['telefone']) ) { update_post_meta( $post->ID, ‘Telefone’, $_POST['telefone'] );}
      if( isset($_POST['fax']) ) { update_post_meta( $post->ID, ‘Fax’, $_POST['fax'] );}
      if( isset($_POST['email']) ) { update_post_meta( $post->ID, ‘E-Mail’, $_POST['email'] );}
      if( isset($_POST['horarios']) ) { update_post_meta( $post->ID, ‘Horários’, $_POST['horarios'] );}
      if( isset($_POST['transportes']) ) { update_post_meta( $post->ID, ‘Transportes’, $_POST['transportes'] );}
      }
      }

  • http://html5based.com dip

    This is an awesome article, very helpful. Why do i see error page “Page not found” ? I am unable to determine. Any help is highly appreciated.

    Thanks

  • http://rabbitweb.com.au Cairns Development

    Where do you see the ‘page not found’?

  • http://towfiqi.com/ Towfiq I.

    Great Tutorial. But when the WP_DEBUG is true I get these errors

    Warning

    – Debug: Trying to get property of non-object on line 93 of C:\xampp\htdocs\wordpress\wp-content\themes\themex\functions.php
    – Debug: Undefined index: price on line 93 of C:\xampp\htdocs\wordpress\wp-content\themes\themex\functions.php
    – Debug: Undefined index: price on line 82 of C:\xampp\htdocs\wordpress\wp-content\themes\themex\functions.php

    Any help?

  • majed

    hi everyone

    how to add my new type to my site’s navigation.

    I went to Themes->Menus and added our new type to my site’s navigation. Then, I clicked through to our custom post type.

    i hope someone can answer me quickly

    thanks

  • http://www.thescube.com/ Shovan

    Thanks for the custom post type tutorial, Was looking forward for this resource, You have explained it clear and to the point. Going to try it my self :D

    Cheers,
    Shovan S
    Web Designer / Creative Director

    t: http://www.twitter.com/ShovanSargunam
    f: http://www.facebook.com/ShovanSargunam
    w: http://www.shovan.org / http://www.thescube.com
    y: http://www.youtube.com/ShovanSurya
    l: http://www.linkedin.com/in/ShovanSargunam
    f: http://www.flickr.com/photos/shovan

  • http://bdwm.be Jules

    This is the best wordpress tutorial I have ever seen. I’ve been looking for days for a descents example of adding additional inputs for custom post types! Thank you so much!

  • emma

    hi, sorry if this is a stupid question, but where do i actually put the code you’ve included under the “Adding Our Own Inputs” header??

    thanks very much!

  • http://www.audiliew.sg Audi Liew

    How do you differentiate the various posts (regular and custom) when showing them on the homepage?

  • http://www.candywiz.com komal

    this is the thing for which i had been looking for. thanks :)

  • http://www.aesthetic-dentistry.com/ Tooth Veneers San Francisco

    Ohh wow.. wordpress rocks..!!
    i love the way wordpress has been designed and over looked here.. :) i love it..

  • http://www.bestcustomflags.com/ Custom flag

    Yeah wordpress rocks.. wordpress is just getting better and better..!!

  • http://gunvaultgunsafe.com richard richards

    ohh man.. wordpress rocks.. this is awesome working by the writer and i should say this is what i am looking for.. Drupal and wordpress are getting better and bette. no one can beat wordpress.. who ever expert in PHP or java cant beat wordpress..!!

    Cheers. ;)

  • http://news.linetoweb.com Raj Mehta

    Yeh i like WordPress and custom post features too :)