580 Responses

  1. Michael
    Michael Published |

    Awesome Post! Thanks Justin.

    Reply
    1. Husky
      Husky Published |

      Well wordpress has certainly come a long way since the start and i love all the new features they keep churning out with most updates. I still believe they are the best content manager system for beginners.

      Reply
  2. Jake Spurlock
    Jake Spurlock Published |

    Great write up, love how simple this whole process is now.

    I have a bunch of ideas stewing about what to do with this…

    Reply
  3. Ryan
    Ryan Published |

    Thanks for the rundown on custom post types Justin, it’s much appreciated :)

    Reply
  4. Jeriko
    Jeriko Published |

    What happens to posts with a custom post type, if the according plugin or theme’s deactivated? Will they be treated as regular posts instead?

    Reply
  5. Shawn Hesketh
    Shawn Hesketh Published |

    Thanks for this timely and in-depth article. I needed this information right now for a client site who wants to create a directory site for bands, listing their profiles. I’m in over my head, but this article will help. Thanks again!

    Reply
  6. Jean-Baptiste Jung
    Jean-Baptiste Jung Published |

    One of the most interesting tutorials I have seen in a while. Thanks a lot!

    Reply
  7. Brad Williams
    Brad Williams Published |

    Excellent post Justin! For anyone wanting to play with custom post types but not comfortable writing code check out my custom post type UI plugin:

    http://wordpress.org/extend/plugins/custom-post-type-ui/

    Reply
    1. Idealien
      Idealien Published |

      There is also CMS-Press which does a lot of the same as the plugin you mention. Both allow you to create taxonomies and assign them to any post type you create. Neither, to my knowledge, yet allow you to do the same for meta boxes which would be a sensational aspect to add.

      In both cases I think that proving the concept of UI based management for post types, taxonomies and meta boxes via plugin is important, and equally something that should make its’ way into core (or canonical at the very least).

      Reply
  8. Matthew Simo
    Matthew Simo Published |

    Great write up Justin, got me re-excited about custom post types in 3.0…

    Time to do some more playing!

    Reply
  9. Ben
    Ben Published |

    Great tutorial. This is definitely one of the most exiting features of 3.0.

    Ultimately it’s the user that will benefit from this because as themes developers we wont need to set complicated metadata up and explain how to use them, we will just create the appropriate post type that will handle everything seamlessly.

    Let the “CMS” die and bring up the “Framework”.

    Reply
  10. Andreas Nurbo
    Andreas Nurbo Published |

    Excellent. Been looking forward to this post.
    Great work

    Reply
  11. Jeffro
    Jeffro Published |

    First off Justin, excellent guide. I also like the idea of calling them custom content types. However, even after this guide, I still don’t get it. I hear people describe custom post types and all I can think about is why not use categories, tags, etc as they seem to address the problem already. What are the differences between using that and this custom post type stuff? I don’t understand the limitations of how the current system works via pages, posts, etc versus custom post types.

    Reply
    1. rgregory
      rgregory Published |

      I recently created a site for a horse farm using wordpress. They list all the horses as posts, and the owner can’t create the new listings as she has SEVERELY limited computer skills. Each horse needs birthdate info, breed, and heritage info.

      Now I can create a new post type with info boxes for the Name, birthdate, breed, heritage and other info. She can fill these in and I can output a nicely formatted ‘post’ for her without her being able to mess up the formatting.

      This also allows news posts to continue without interruption.

      Reply
  12. Excellent Custom Post Types Tutorial - WordPress Tavern Forum
  13. Jason Rhodes
    Jason Rhodes Published |

    Been waiting for this for a very long time. Thanks for the detailed write up.

    Reply
  14. paul
    paul Published |

    Justin

    when you create new post types, do they get stored in the posts table?
    if that’s the case, I don’t think it’s very efficient for any kind of database driven application.
    If you’re using a relational DB, then it should use normalization, primary and foreign keys,etc…
    I think that’s something that PODS does.
    for example, if you have movies, actors, genres, etc… how is this translated to the DB schema?

    Reply
    1. Otto
      Otto Published |

      Actually, normalization of database schema is slower. By a long shot. Many table JOINs are expensive as heck.

      The purpose of normalization isn’t efficiency; the purpose is for data integrity. When your data is normalized and you have proper foreign keys and constraints and such, then it’s possible to ensure that you never enter invalid data.

      In this case, that’s not the primary goal, because most any type of data you could enter would be valid. So efficiency and speed-wise, it’s faster to store all the posts (regardless of type) in the same place. Good indexing solves the speed issues. And your JOINs are greatly reduced when you’re not having to pull from multiple tables to retrieve multiple types of things.

      Reply
      1. paul
        paul Published |

        yes I suppose data retrieval is more efficient, and that’s how it’s done with data warehouses, where all data is in one table for faster queries.

      2. Matt
        Matt Published |

        As a developer on the Pods CMS project, Otto is *half* right.

        Yes, it’s usually quicker if you can avoid using joins. Custom post types by themselves don’t need joins since they’re in the posts table.

        However, custom fields do require table joins…

        I’ll go out on a limb and say that a lot of people are going to want a unique set of custom fields for each post type. Not only that, but they’ll want to filter based on one or more of these custom fields.

        For example, for an “Event”, you may need custom fields for latitude, longitude, end date, address, speakers, etc. What if you only want to show events within a certain lat/lng range?

        For these situations, Pods is *vastly* more efficient since you’re only querying a single table. With Pods, all the (non-relationship) fields for an event are stored in a single row.

        On the other hand, WP needs to JOIN with the postmeta table (at least once). Since postmeta data is always LONGTEXT, indexing is a huge challenge and the data isn’t subject to any MySQL optimizations.

  15. Dean McCean
    Dean McCean Published |

    Hey Justin, I just started with wordpress and tried to figure that out by myself – No way! Thank for thi great solution, nice tutorial ;

    Reply
  16. John Myrstad
    John Myrstad Published |

    O`Reilly still havent called you ?

    Reply
  17. Andy
    Andy Published |

    Awesome tutorial. One thing I frequently use wordpress for is basic e-commerce. Usually I use pages as products with a custom template and custom fields for things like prices. Is there anyway I can add an extra input box for “price” rather than forcing the user to to use the slightly more confusing custom fields? I don’t really care if the data is stored in a custom field, I just want the boxes to be easier to understand.

    Also, how can I make a custom post type default to a specific template rather than forcing the user to keep selecting one?

    Thanks foe the awesome tutorial!

    Reply
    1. John Myrstad
      John Myrstad Published |

      ….Since this is a “custom” post type, I’ll assume you want to customize how it’s output. To overwrite the default, you can create a custom template. Our template will be called single-super_duper.php.

      Reply
    2. Idealien
      Idealien Published |

      Andy – Check out this tutorial on creating meta boxes with custom post types. The data is still stored in custom fields but it shows up in the admin area in code-defined ways. So you could have price, inventory, available sizes, etc all within a “product details” meta box that goes along with the standard description + photos in the editor window.

      All stuff you *could* do before 3.0, just a lot easier to explain and tailor to terminology clients are familiar with now.

      Reply
    3. Rilwis
      Rilwis Published |

      To add a custom meta to a post, even in custom post type, you can see an easy way in this tutorial. It’s easy to define and create some additional meta data for posts.

      Reply
    4. Hayden
      Hayden Published |

      @Andy Idealien is correct. You could create meta boxes. I would also look into creating taxonomies for better content organization.

      Reply
  18. Brad Potter
    Brad Potter Published |

    Thanks so much Justin. Lots of great information there.

    Jeffro – For me, I think the power of custom post types is that you can control which panels appear on the edit screen based on the type of content the end user is adding. Imagine creating a site for a client that needs an event log and customer contacts. Events & Contacts could be 2 new content types each with edit screens tailored for the type of content being added. The edit screen would have less clutter and would be less confusing to end users whose job is to simply add content.

    Reply
  19. Danny G Smith
    Danny G Smith Published |

    I am beginning to get into them in a big way and am very to happy to see this post. The codex is slim right not on all of the options. It looks to me like the power will be in adding other content types as well, and I am not finding a lot of details on that. I am going to take a look at wp-includes/post.php and see if that sheds any light.

    thanks for all you do!
    Danny

    Reply
  20. Matt Wiebe
    Matt Wiebe Published |

    Great work explaining things here Justin. A lot of this should be copy & pasted into the Codex entry for register_post_type()!

    One of the big gaps in custom post types is the lack of a proper landing page index for your post type. (eg http://yourdomain/super_duper/) I made a helper class for that in my post Smarter Custom Post Types in WordPress 3.0.

    Reply
    1. Idealien
      Idealien Published |

      @MattW – Another option is to create a page template (page-{posttype}.php) that has a separate loop and display the contents of the post type as Justin has demonstrated above. This would be closer to using category-##.php if you were using posts / categories to achieve the same result prior to 3.0. The rewrite => ‘slug’ option even allows you to have ‘/toplevelpage/subpage/reallydeeppage/’ as the permalink so that you could have all your custom data types show up within the same area that you have the page permalink. This might require your settings -> permalink to be /%postname%/ I think.

      I’m very happy that this has come to core with 3.0. If nothing else it means that I can stop development for my Category Enhancements plugin (http://wordpress.org/extend/plugins/idealien-category-enhancements/) as the ability to use single-{posttype}.php and page for collection display is really all that it offered.

      Reply
      1. Matt Wiebe
        Matt Wiebe Published |

        Indeed, the page template idea would work fine. But you wouldn’t get pagination with it, or feeds, which my helper class gives you.

  21. Vehicle Transport
    Vehicle Transport Published |

    Do you have a screenshot of what the finished product would look like? I’m in the middle of working with a Wordpress-based website that I’m creating, and I am discovering that to convert my blogger blog to the Wordpress site has really messed up my blog posts…Is there any easy way to fix this without having to re-write each one?

    Reply
  22. Jan Egbert
    Jan Egbert Published |

    Wonderfully written Justin.

    It’s time for a big ‘Find & Replace Operation’ in everything that has ever been written about WordPress. Because it’s so much more than blog software.

    Reply
  23. Danny G Smith
    Danny G Smith Published |

    Is that the reason I get a 404 when I run this code? My theme has a single.php.

    $carousel = new Carousel;
    
    add_action('init', array($carousel, 'carousel_tax'),  1);
    add_action('init', array($carousel, 'carousel_type'), 2);
    
    class Carousel {
    
       function __construct() {}
       function __destruct()  {}
       
       function carousel_type()
       {
          register_post_type('featured', array(                                     
             'label'                 => __('Carousel Posts', 'carousel-container'), 
             'execute_from_search'   => true,
             'public'                => true,
             'capability_type'       => 'post',
             'hierarchical'          => false,
             'supports'              => array(
                   'title',
                   'excerpt',
                   'editor',
                   'thumbnail',
                   'revisions',
                   'custom-fields' 
                   ),
             'taxonomies'            => array('post-tag', 'category', 'carousel-tax')
             )
          );
       }
       
       function carousel_tax()
       {
          register_taxonomy('carousel-tax', 'carousel-container', array(
             'hierarchical'    => false,
             'show_ui'         => true,
             'label'           => __('Page where Carousel Posts will show', 'carousel-container') 
             )
          );
       }
    }
    Reply
  24. Doron Orenstein
    Doron Orenstein Published |

    I’ve really enjoyed using Magic Fields up until now, and supposedly, this makes Magic Fields obsolete.

    However, I’ve run into a couple of roadblock here as far as doing client work:

    1) I liked how Magic Fields made it really easy for clients to upload images into the custom fields instead of having to perfectly type a long and ugly URL. Looks like using Custom Post Types is a downgrade in that this functionality is now lost

    2) If a site is using a home page slide show for blog posts and I want to mix some of my new Post Types in with the blog posts for the homepage slide show, even if I add the correct category using the Custom Taxonomy, my theme is not registering the custom posts as a regular blog post, so there does not seem to be an easy way to have these posts appear on the homepage slideshow.

    If anyone has any ideas of how to overcome these 2 issues, that would be great.

    Either way, thanks for the great post Justin!!

    Doron

    Reply
    1. Doron Orenstein
      Doron Orenstein Published |

      OK, so I’m now able to get my new custom posts working with my homepage slideshow as these new custom type blog posts are being mixed in with my regular blog posts.

      The instructions are here:
      http://justintadlock.com/archives/2010/02/02/showing-custom-post-types-on-your-home-blog-page

      Still curious about creating a more elegant back end for the client to upload images into like I had with Magic fields, any leads would be awesome!

      Thanks!

      Doron

      Reply
  25. Hobbsy
    Hobbsy Published |

    Great article Justin. I’m sure this is going to come in real handy

    A small aside, and I could be wrong here, but is there a slight typo in the code?

    should the code in the grey code for singular_label be

    'singular_label' => __( 'Super Duper' ),

    instead of

    'label' => __( 'Super Duper' ),
    Reply
  26. Danny G Smith
    Danny G Smith Published |

    Ok, just got email back from wp-testers, be sure to regenerate your permalinks after adding new custom posts, or you may not be able to see them, that was my problem above.

    Reply
  27. are jay
    are jay Published |

    Could something like this be used to allow for publicly submitted events to go into a moderation queue?

    Or know of anything?

    Thanks.

    Reply
    1. Jan Egbert
      Jan Egbert Published |

      I’m using Gravity Forms + custom post types to let users suggest their own events. Gravity Forms lets me set publish_status to Draft and although right now you need some basic coding skills , I’m sure Gravity Forms will have full support for custom post types and taxonomies very soon.

      Reply
      1. Mikey Leung
        Mikey Leung Published |

        Yes, I think the Events Calendar has a lot of potential to roll out events-based websites. The problem is that it is still immature and has a few bugs, but I see the developers working very hard on getting this up to speed.

  28. links for 2010-04-29 at DeStructUred Blog
  29. Todd J. List
    Todd J. List Published |

    Thank you for such a detailed description. I’m starting to get excited for WordPress 3.0. I’ll have to chew on the possibilities here for a while.

    Reply
  30. Stephen Cronin
    Stephen Cronin Published |

    Great write up Justin,

    Hope you can follow up with more on this topic.

    For me, Custom Post Types are really only useful when you can search for things via the custom taxonomies (and more than one at the same time).

    Using the Movie DB example, I’d want to give the users a search where they can specify the actor name and the genre. eg: find me movies with actor=”Matt Damon” and genre=”Espionage”.

    I haven’t looked into how to do this yet, but it seems no one has either. If you know how, I’d love to read how!

    Reply
  31. Andrew
    Andrew Published |

    Will be bookmarking this really nice and helpful tutorial. Thanks so much!

    Reply
  32. Joss
    Joss Published |

    No dice on the WP 3.0 beta :( tried a few times but can’t get the rewrites or query vars to work. It keeps giving bad requests, not playing nice with permalink settings :O

    Hope it gets smoother in WP3.0 full release!

    Reply
    1. Jan Egbert
      Jan Egbert Published |

      A quick solution is to reset your permalink settings. Go to Settings > Permalinks and press Save settings. Rewrite rules usually work fine after this trick. Weird, but true.

      Reply
  33. Piet
    Piet Published |

    Hi Justin,

    Thanks so much for your write-up on this subject! It is great to at least be able to understand a bit of all these new functions in the upcoming WordPress version.

    I agree with for example Brad, that for an end-user the dashboard can become much more intuitive with using custom post types; normally it takes quite a bit of effort to let them understand what Posts exactly are, now you can just give them the exact name.

    I have one question, that perhaps you can help me out with. As I am in Europe and (have to) make quite a few projects in multiple languages, how does this work for naming the custom post type? Take for example your “books” suggestion. In other European languages, books obviously is a different word. Is it possible to use get_text calls in naming the custom post type or not?

    Again thanks so much for this tutorial!

    Piet

    Reply
  34. Bristol solicitor
    Bristol solicitor Published |

    This bog is really useful for the word-press user who more ever work over on it. thanks and keep it up …

    Reply
  35. Xavi Esteve
    Xavi Esteve Published |

    Thanks for the guide Justin, that’s exactly what I was looking for!
    BTW, where can I read more documentation on Wordpress 3.0?
    Cheers.

    Reply
  36. Idealien
    Idealien Published |

    Which of the following do you think makes the most sense and a few questions on how to achieve…I am trying to create a custom post type that is “as close to completely idiot proof and self-explanatory” as possible. Using the scenario of creating a custom post type that stores quotes for display throughout the site (sidebars, etc).

    1) Customize the text from ‘Enter Title Here’ to say “Enter Quote Author” so that I can use the title field to generate the quote slug. If I do not use the title field the slug gets generated as ‘auto-draft #’ and you lose the ability to quick edit / trash from the edit menu.

    2) Register a post type with only a meta box (no title, editor) to capture all details (author, quote, author title, etc). What action / hook / filter to connect with to modify the slug generation to match a meta box field? How to specify a column in the edit table view should have the quick edit / edit / trash UI options applied to it?

    Reply
  37. Brad Thomason
    Brad Thomason Published |

    Hi Justin,

    Great post. One feature I haven’t seen covered anywhere in articles related to custom post types is a listing feature. Do you know if there is an implementation similar to wp_list_pages() or wp_list_categories() that has the power of those functions? Something like wp_list_super_dupers()?

    I’m particularly interested in a function that would list your custom post types, create sublists for children, and echo classes (ie. similar to current-cat, current_page_item, current-cat-parent, etc.) for hierarchical and active relationships in a post or page method (depending on how you enable the custom field).

    If there isn’t one, there desperately needs to be, in my opinion. That would seal the deal.

    Reply
    1. Brad Thomason
      Brad Thomason Published |

      …or, thinking about it a bit more, a function a bit more broadly applied, like:
      wp_list_custom_post_types()?

      Reply
  38. Benjamin Cahill
    Benjamin Cahill Published |

    Are there any event plugins that take advantage of custom post types and have a calendar? If not, I may build one.

    Reply
  39. Sawyer
    Sawyer Published |

    Great and very helpful post. I have my custom post type all set up, however, I was wondering how you get the correct category archive setup for these posts? Right now it’s only displaying posts from the blog.

    Reply
    1. Ken
      Ken Published |

      They are adding the archive template functionality in 3.1, stay tuned!

      Reply
  40. Andrew
    Andrew Published |

    Question for Justin or any guru.

    I’ve noticed that creating a just one custom post type adds about 15 new rewrite rules. (18 or 19 if you use CMS Press or Matt’s wrapper for index page archiving –> #comment-188177)

    My question is this. I have a current site, which I’d like to port to wordpress to handle the content, and I can foresee at least 10 – 15 different “custom post types” that I’m going to need to set up.

    15 post types * 19 rules/post type = 285!

    Is that number high? I’m worried about performance. The site currently gets roughly 1000 visitors a day, but peaks at 3k.

    What is an acceptable number of rewrite rules?

    Reply
    1. Konstantin
      Konstantin Published |

      It’ll be fine unless they’re in your .htaccess ;)

      Reply
  41. WP 3.0 and Custom Post Types
    WP 3.0 and Custom Post Types at |
  42. WPWeekly Episode 98 – WordPress 3.0 And WordCamp San Francisco
  43. Me and My Wordpress
    Me and My Wordpress Published |

    I Not Yet understand with this, but thank you very much for sharing. I’ll come back again to learn this.

    Reply
  44. What I Learned About WordPress last week #1
  45. Konstantin
    Konstantin Published |

    Great post Justin!

    Reply
  46. Idealien
    Idealien Published |

    It’s curious that menu_icon was added to show in the left-hand-menu but something like editwindow_icon which displays the larger 32 pixel version (/wp-admin/images/icons32.png) along with the Add New / Edit [Post Type] Title was not.

    Reply
    1. Hayden
      Hayden Published |

      @Idealien, I agree. It seems kind of stupid to have the correct menu icon not have the option to create a larger one for the specific pages.

      Reply
  47. Roberto Costa
    Roberto Costa Published |

    Hi Justin,

    I’m relatively new to WP and I’ve been looking for a solution to paginate custom post types for quite a while now with no success yet.
    Your suggestion works to the point of displaying my custom posts list. However, pagination is broken. Using wp-pagenavi, only a box with “Page 1 of 0″ show below the post list which I limited to 2 posts for testing. Using wp default pagination tags, nothing shows below the posts.

    Other relevant details:
    - I placed the query on a page template (see below), created a new page and chose this custom page as the template.
    - This page is not my front page. It’s accessed by a wp_page_list menu item.

    Isn’t it possible to paginate custom post types? I don’t believe so. I prefer to believe it’s my fault. Can someone please help me out of this problem? I’m almost throwing the towel. Thank you in advance.

    My template code:

    <!-- http://justintadlock.com/archives/2010/04/29/custom-post-types-in-wordpress -->
    	
     'noticias', 'posts_per_page' => 2 ) ); ?>
    
    			
               		ÚLTIMAS NOTÍCIAS
            
    have_posts() ) : $loop->the_post(); ?>
                    
                        <a href="#" title="" rel="nofollow"><img alt="" src="/images/thumb_dalva.jpg" /></a>
                        
                            <a href=""></a>
                            
                            <a class="continue-lendo" href="" rel="bookmark">Continue lendo</a>
    Reply
  48. Roberto Costa
    Roberto Costa Published |

    Sorry, the code was posted wrongly. How do I post it right?

    Reply
  49. Donalyza
    Donalyza Published |

    Will this replace custom fields?

    Oh btw Justin, where is your search box in this blog?

    Reply
  50. Custom Post Types Sources You Should Know About | BloggingPro
  51. Tom
    Tom Published |

    Hi Justin,

    Really helpful article to get me started on the WP 3.0 beta but I have one thing which I have been stumped on for a few days! Not sure if it’s something I am doing wrong or if it hasn’t been implemented in the beta yet!

    Working completely I have :
    domain.com/post_type_name/
    domain.com/post_type_name/post_title

    Is it possible to have :
    domain.com/post_type_name/post_type_category/

    This page would list all the custom post types that are within that category. I know I can create a Page for each Category and have a different WP_query on each page, but when this is dynamic and more Categories are added there is a problem!

    Any help is much appreciated!

    Thanks

    Reply
  52. Jauhari
    Jauhari Published |

    Wonderful Tutorial…

    Reply
  53. Tim
    Tim Published |

    Awesome tutorial. By far the best one I have found regarding custom post types yet.

    I got the custom post type working for the most part and can query them just fine but I am having trouble filtering the posts using permalinks. In the left nav I did a list of the taxonomies to use as navigation but the permalinks arent working. They’re going to the 404.

    I tried changing the slug to what you listed a couple posts up but that broke all of it.

    Here is my code for the custom post type and the taxonomy:

    register_post_type('project', array(
      	'label' => __('Projects'),
      	'singular_label' => __('Project'),
      	'public' => true,
      	'show_ui' => true,
    		'_builtin' => false,
      	'capability_type' => 'post',
      	'hierarchical' => false,
      	'rewrite' => array('slug' => 'projects', 'with_front' => false),
      	'query_var' => false,
      	'supports' => array('title', 'editor', 'author', 'category')
    	));	
    	
    	register_taxonomy( 'categories', 'project', array( 'hierarchical' => true, 'label' => __('Project Category'), 'query_var' => true, 'rewrite' => array('slug' => 'projects', 'with_front' => false) ) ); 
    Reply
  54. Derek
    Derek Published |

    I went ahead and replaced register_post_type() on my wordpress install with your create_my_post_types() function.

    Reply
  55. Custom post types in WordPress | WPLover
  56. Jason Pelker
    Jason Pelker Published |

    So many comments!

    This seems like a great plugin to help with creating new custom post types: http://vocecommunications.com/services/web-development/wordpress/plugins/cms-press/

    I found it not too long ago and I don’t know if many people know about it yet. Anyone have a review for it? It does work as advertised, but only an expert would know if it goes about custom post types the right way. I’m curious…

    Reply
  57. Banago
    Banago Published |

    With 3.0 beta2 I have started developing websites with custom content type. I keep coming back to the article – it is such an amazing work putting that together Justin – Thanks very much!

    BTW – It seems I’m the 100th commenter :D

    Reply
  58. links for 2010-05-11 | Links | WereWP
  59. jeff
    jeff Published |

    Justin, thank you for this. As always, you’re a great resource.

    One thing that I cannot grasp. When I first heard “custom post types” for WP I was very excited because I envisioned something similar to “Custom Content Types” that Drupal offers.

    The most important feature being the ability to EASILY add custom fields to these content types. So the user who is writing the post would not only see “Title” and “Content” fields for a “Movie” post type, but would also see “Actor” “Director” (etc.) fields where they can easily input the info and it would be displayed in the main body of the page with the content.

    I don’t see how Taxonomy solves this. They are still just tags and do not appear in the main body of the post.

    This is the main reason I must use Drupal for some jobs instead of WP. Some clients need many custom content types (Events, News, Reviews) that need specific fields they can easily fill out and then be displayed.

    I am probably missing something, but adding Custom Fields to a new Custom Post does not seem like an easy task via the control panel…. lots of code customization? I hope I am wrong.

    Reply
    1. John Myrstad
      John Myrstad Published |

      You may find what you look for in plugins like More Fields, Magic Fields , Verve Meta Boxes and Custom Fields template, once they are updated for 3.0.

      Reply
      1. shawn
        shawn Published |

        quick fyi
        Verve Meta Boxes was updated today and works perfectly with 3.0 so far. I am very happy with it.

    2. shawn
      shawn Published |

      If by adding ‘actor, and director’ in the admin panel, you mean simply adding in the name of the actor and director, then taxonomies are perfect for that. It’s fairly simple to get the taxonomies related to a given post to show up on a page. Check out Justin’s movie post and you will see it in action exactly as you described.

      Now if you are talking about giving the user the ability to also assign meta data to the actor such as a picture and description as well, then…

      currently I only see 2 possible solutions to this issue, which is exactly what I am working on myself.

      1. taxonomy metadata plugin
      http://wordpress.org/extend/plugins/taxonomy-metadata/

      I have only just begun to play with that plugin, but it looks like it is almost perfect for the job. I only wish the author would have given some clear examples of how to implement it. Right now it’s more for php jockies than regular users.

      2. relational post_types plugin (posts-to-posts)
      http://wordpress.org/extend/plugins/posts-to-posts/

      This one I have actually had a bit of luck with, and can see some serious potential, esp since Scribu wrote it, and he’s the master when it comes to post_types. Give it some time though, as it’s only a few days old.

      Either one, or a combination of the two, should accomplish 95% of everything your mentioning. Especially when Scribu adds the ability to edit one post_type within another post_type admin panel.

      If these don’t fit your needs, check out pods. It does exactly what you are after, and 10x more. For me at least, I prefer for now to stick with native wp functionality, and frankly pods was above my pay grade lol..

      Reply
  60. angga
    angga Published |

    justin, great tutorial

    i’m wp newbie , for this custom type,
    how to make pagination with this custom type
    seems i have wrong permalinks

    i’ve this post-type url (standard slug from register_post_type):
    wp/post-type/post-url

    after click next page, this is the url:
    wp/post-type/page/2
    then redirected to home

    can you help me.

    thanks

    Reply
  61. Where’s The Landing Page for Custom Post Types In Wordpress 3.0? | Web Citizen Magazine
  62. WordPress 3.0 Custom Post Types: Joke posts
  63. David Swain
    David Swain Published |

    Justin

    Is there any way to get a hierachy or the category in the url? i have tried ‘hierarchical’ => true, but nothing changes… have i done something wrong?

    I want something like:

    example.com/images/category-name/custom-post-type-name

    where ‘images’ is the post type.

    Thanks

    David

    Reply
  64. Excerpts for Pages in WordPress 3.0 | Michael Fields: WordPress Development
  65. arkadaslik sitesi
    arkadaslik sitesi Published |

    One of the most interesting tutorials I have seen in a while. Thanks a lot

    Reply
  66. jack
    jack Published |

    how can i copy single.php to single-book.php ,I want to do how to use this page

    Reply
  67. WordPress 3.0 and Custom Post Types » Otto on WordPress
  68. saqibimran
    saqibimran Published |

    This is my first time I have visited here. I found a lot of interesting stuff in your blog.Thanks a lot.

    Reply
  69. Why Custom Post Types are Great | alexking.org
  70. driz
    driz Published |

    If you create a type for example called portfolio and your example content might /portfolio/postone/ should you be able to view anything at /portfolio/ like an archive or something or do you have create a page and fake it.

    Reply
    1. Pedro Augusto
      Pedro Augusto Published |

      Driz, this is exactly what I’m trying to figure out… I tested many possibilities, but without sucess until now. I have 3 post types. I created different template files for each one of them, the content opens perfectly, like /event/staff-meeting. But when I try just /event/ to have a list (loop) of all events of that post type, I’m not getting sucess. Someone knows how to make this possible?

      Reply
    2. Pedro Augusto
      Pedro Augusto Published |

      Afff… Finally I got an answer to this! Permalink structure for pages is actually what we want. A page called “Event” will have /event as its permalink (since ‘event’ is its slug). What I did was, create a page and call it “Event”. Making use of WP template hierarchy, I created a file and called it page-event.php. And then I placed my post-type query for events in it:

      Not found message goes here…

      <?php the_title();

      Does someone have a better idea? Suggestion?

      Thanks for this excellent post Justin!

      Reply
    3. Pedro Augusto
      Pedro Augusto Published |

      Trying the code again…

      `

      Not found message goes here

      `

      Reply
    4. Transporter78
      Transporter78 Published |

      dont know if its new, but you can simply copy your existing category.php/archive.php file and rename it to archive-{posttype}.php. Now /portfolio/ works as an archive of custom posts.

      Reply
  71. Marcus Paris
    Marcus Paris Published |

    Honestly… you’re a genius. I’m in the process of building my first web site (wordpress platform) and this info is priceless. I think I will print the page to have it close by. Thanks for the info. I’ve bookmarked your site and I will surely return.

    Reply
  72. Pedro Augusto
    Pedro Augusto Published |

    I’m sorry… how can I show the php code on this comment form?

    Reply
  73. When it clicks | John Hawkins Unrated
  74. Drew
    Drew Published |

    Instant bookmark… gonna be needing this in the next few months for sure!

    Thanks for taking the time to go through all of these features.

    Reply
  75. pmdci
    pmdci Published |

    I think there is a but in WP 3.0 b2 when using the is_post_type() function…

    I tried adding the following code in my sidebar:

    if ( is_single() && is_post_type(‘post’,$post_id) ) { include ‘datasheet.php’; } ?>

    So the idea is that when viewing SINGLE pages and only of the type POST (the default post type), it would then include the datasheet.php

    However, it happens that datasheet.php is being included when viewing ANY post type. Besides the default post type, I have 3 others. The datasheet.php appears when viewing any of those posts.

    Now for something curious: If I type for my post type name something that doesn’t exist, say:

    if ( is_single() && is_post_type(‘garblegarblegarble’,$post_id) ) { include ‘datasheet.php’; } ?>

    Then the datasheet.php is NEVER included when viewing a post…

    Probably a bug, right?

    I posted about it on the forums: http://wordpress.org/support/topic/402823

    Regards,
    P.

    Reply
  76. Summer
    Summer Published |

    This is an excellent post for us wordpress bloggers. Lots of useful information, thank you for posting it.

    Reply
  77. Complete Guide to WordPress 3.0 Awesome New Features | Digging into WordPress
  78. Håvard Pedersen
    Håvard Pedersen Published |

    This is just awesome! I have several ideas already for what to do with this. :) But is there any way to attach per-user metadata to custom post types, like a rating or an event attendance status?

    Reply
  79. Meesan | Gaming Computers Canada

    Great guide! I’ve learned a ton off of all these little tips! Thanks for the great advice! Absolutely incredible info. Thanks again!

    Reply
  80. yeswework
    yeswework Published |

    Hi Justin,

    along with almost everyone else, we’re really looking forward to custom post types in WP, but we’ve got some niggling doubts about the implementation, or about how various WP blogs are suggesting post types be implemented. Primarily, isn’t functions.php the worst place to set up post types, since register_post_types also affects the GUI of wp-admin – which is never usually theme-related? If one sets up post types within a theme-specific file that also happens to be subject to fairly frequent changes and improvements during build and once a site is live, aren’t there several big risks? Namely:

    1) you could register a new custom post_type, start inserting posts, and then (you, a co-worker, a hacker, an ftp error) could willingly or inadvertently change functions.php and change the definition of the post_type (which, being a theme file not core wp-admin, wouldn’t run checks/validation of the definition against the database) leaving all the posts already entered either orphaned or broken, and the database cluttered with irretrievable junk.

    2) your register_post_type function will get called at every page load: isn’t that wasteful at best, risky at worst?

    3) you (or your client) could switch theme and, in doing so, lose the custom post_types – not just their display, but their admin too. It’s one thing to need to re-jig a theme to display them properly, but surely quite another to have to redefine their structure?

    Although you mention in the article that register_post_types could be called from a plug-in, this also seems contradictory for such a deep-rooted new feature: we can imagine lots of competing plug-ins emerging, some with checks and balances, some without; some with neat admin GUIs, some without. Maybe that’s a benefit – natural selection will ensure the best plug-in emerges eventually – but in the meantime, WP support risks being flooded with desperate cries for help.

    People often mention drupal and the CCK module… the point with that seems to be that the development path happened the other way round to WP and custom post types: CCK was developed (and evolved) as an external module for adding custom node types. It was only taken into drupal core once it (and its administration and security models?) were judged mature, stable and useful enough. With WP, what appears to be happening is the opposite: a core feature is added, but apparently without a good wp-admin section or data security features, and its implementation is being left up to non-core plug-in developers and, even worse, themers like me.

    Doesn’t this risk making implementation of the new custom post types feature patchy and buggy, reducing WP’s perceived simplicity and strength? Custom post types seem to us to be so important that their registration and management should be in core wp-admin just as most of the best new features of recent releases have been.

    Our understanding of the way post_types will work may be flawed or incomplete, in which case we’d LOVE to be reassured/corrected, because we really can’t wait to use them and feel that they’ll make WP an even stronger system for even more flexible sites. But we’re a bit worried at the moment.

    Any comments?

    Reply
  81. Building a Site with New WordPress 3.0 Content Types: Part 1 of Several - CogDogBlog
  82. Efe
    Efe Published |

    I have been looking around the database and found that custom post types are implemented very cleverly. First of all, it is not really going deep rooted, its just an attribute in wp_posts table, all the magic is done on php level and everything is based on (imho) already perfectly working post/page post types. I believe they have been already making code level changes for custom post type to be possible for a long time (like unifying the editor page for posts and pages).

    My 2Cs;

    1-) functions.php is one of the right places to make the registration, custom post types can be seen as a feature of the theme.
    2-) all logic regarding finding and displaying custom posts created when the theme is loaded. Therefore WP_Query and co is aware of the new custom post type after register_post_type() has run. There is no database query to ‘discover’ their presence. I find this effective, fast and flexible.

    So, I think there is no need to worry,
    Cheers

    Reply
  83. Ilia
    Ilia Published |

    The major functionality I was waiting from WP 3.0 was Custom Post types. But I still don’t see how to determine exact custom fields for custom type.
    I mean: we create movies database and create custom field “Actor”. Is there a way to only show this custom field when editing custom post type “Movies”? Because when I create a usual post I see “Actor” in custom fields and so on…

    Reply
  84. Renee
    Renee Published |

    Curious about how to do certain things:
    * Create an archives page (both a list and a search result page).
    * Create sidebar navigation that lists “categories” and recent “posts” from custom post types.
    I wanted to create a section on my site that would allow me to post different articles, and while I can do work-arounds for some things, I’d rather have a cleaner, easier, and much more organized way of doing things before I implement some of my ideas.
    Any way I can achieve those things without to edit a thousand files or create an additional plugin to use?

    Reply
  85. Everything You Need to Know About WordPress Custom Post Types | WordCast
  86. Richard Sweeney
    Richard Sweeney Published |

    Great post! Many thanks for this, you’ve cleared up a load of questions I’ve had!

    One thing I can’t seem to be able to do is to perform a query from a custom post type within a specific category:

    'movies', 'category_name'=>'actors' );
    $the_query = new WP_Query($args);
    $the_query->the_post(); the_content();
    ?>

    I can display the results of the query ok without the category_name, but once I add that it doesn’t display anything!

    Any thoughts?

    Reply
  87. Template Changes/Tags for Wordpress 3.0
  88. Hayden
    Hayden Published |

    This was a good article and proceeds with a good discussion. I am fairly new to PHP programming. I’ve created a custom post type fine and added some meta boxes. I have some questions with regards to creating a meta box for uploading images.

    My custom post type is “Case Studies” which I have the editor registered to show a description for what the project was about. I have a custom meta box for showing the “Services Provided” (which is just a check box group). The final thing I want to be able to do is create some sort of image uploader. For each “Case Study” I want to display images. I would like to use some javascript on the presentation part to display these images.

    Magic Forms was mentioned earlier about easily adding images but I want to stay away from using plugins if at all possible.

    Do you have any suggestions or could you point me in the right direction? Thanks!

    Reply
  89. Tim Nicholson
    Tim Nicholson Published |

    Justin,

    I have really been thinking about custom post types as a great way to have a simple forum that uses the standard WP database tables. I even started hacking some stuff in WP2.9, but decided to wait for 3.0. So I’m VERY interested in your work on a forum “plugin”. Your screenshot you posted looks absolutely perfect as I was thinking of modeling the look and feel like bbPress as well.

    Since it sounds like you are looking for suggestions, I have a couple of key suggestions that wouldn’t naturally be available with just the WP3.0 custom post types:

    1) I would like to a *separate* RSS feed for forum posts. Every discussion forum in the world has this, but this isn’t standard functionality with custom post types. In fact, it appears custom post types were designed to be used more like custom *pages* in that they get a permalink and it can be specified that they are searchable, but they do not appear in any RSS feed format.

    2) Having run various forums over the years, it seems that most website owners would like to be able to easily specify that their “news” (“blog”) type posts get placed into the forums. Historically, people are more willing to comment on a forum than on an actual “news” article. At least that has been my experience with hobbyist type sites. I know this isn’t a problem for Engadget or CNN, but I think for smaller websites it could help increase the number of comments.

    But if the forums are custom post types, then I don’t believe that we can simply flag a “blog” post to appear there, right? This would be easier if the forums were simply blog posts (and their comments) within a standard category taxonomy. i.e. I flag the article in its normal category and also tick off what forum category it should appear in. Notice no duplication of data and comments on the forums will appear on the blog article as well.

    So with the combination of these two requirements (RSS feed and ability to post to the “blog” and “forums” at the same time), would it be better to have forums that are just normal blog posts and use the built-in category taxonomy or create a custom “forum” taxonomy? With that method, you’d have to filter your main RSS feed to exclude the posts that are *only* in the forum (but show them in the “forum” RSS feed). With custom post types you’d have to build your own RSS feed for the forums (I assume) and that sounds harder than simply hiding some posts from the main RSS feed.

    What do you think?

    Reply
  90. Lars Farstad
    Lars Farstad Published |

    Hi Justin, firstly thanks for the article and all the other awesome stuff you do.

    I’ve been trying to figure out the best way to create a relationship between two or more custom post types but haven’t really been able to come up with a good and practical way of creating a direct relationship either as a 1-n or n-n relationship.

    I’ve got the following custom post types:
    - Merchants
    - Special Offers
    - Brands

    Merchants can have multiple special offers however a special offer can only have on merchant.

    Brands can be associated with multiple merchants and a merchant can sell multiple brands. Brands may sometimes be associated with special offers and a special offer may apply to multiple brands.

    So far the solutions I’ve come up with seem to require having duplicate entries for entities e.g. merchants as both a taxonomy or custom field and as a custom post type.

    So far the solution I’ve come up with involves create a custom taxonomy containing merchant names, add that custom taxonomy to both the merchant custom post type and any other custom post type that needs to be associated with that merchant.

    Is there a better way of doing this? E.g. the ability to load the titles of all posts within a single custom post type into a dropdown select box or list of checkboxes in the create interface for another custom post type?

    I just want to make sure that there isn’t a cleaner, more direct or more obvious way of doing this that I’m not seeing before I commit to the custom taxonomy solution.

    Reply
    1. Markgt
      Markgt Published |

      Lars, I’ve got the same problem – associating custom posts types…

      I’ve got DESTINATIONS and TOURS, and have struggled to find an easy way to link the two (both ways), apart from creating custom taxonomies of the same (Destinations and Tours)… and then it starts getting messy – especially if a client has to add a new post AND taxonomy for a new tour…

      Yes! is there any way to load a list of all posts within a custom posts type?

      Has anybody got any ideas? please!

      Reply
  91. WCChigago2010 « Red Letters Studio
  92. Christian Engineers in Development
    Christian Engineers in Development at |
  93. od3n
    od3n Published |

    why does my custom taxonomies (categories and tags) shown up in custom post list?

    how to get it works?

    Reply
  94. A New Post Type… New Problems « Ryan Markel
  95. Nique de Graaff
    Nique de Graaff Published |

    Is it possible to use a slug like this?

    http://www.mallona.nl/webspots/91230/crash-near-schiphol-amsterdam/

    How to add the ID at the slug level. I want this, so the slug-title does not matter anymore. Searching on ID is much faster to get more peformance out of wordpress.

    Reply
  96. Links and Bits for June 7th — Alex Jones
  97. Ovidiu
    Ovidiu Published |

    wondering about your remarks above about the single.php and this text: If you’re using a smart theme like Hybrid, this template will be super_duper.php.

    As I am using hybrid 0.8.1 and there is no single.php only a singular.php I am unsure on which template to base my recipe.php for my new custom post type called “recipe”

    Reply
  98. Joe Dominican
    Joe Dominican Published |

    Is there a better way of doing this? E.g. the ability to load the titles of all posts within a single custom post type into a dropdown select box or list of checkboxes in the create interface for another custom post type?

    Reply
  99. Rick Adlam
    Rick Adlam Published |

    Great post Justin. I somehow found your old post about custom posts on WP 2.8 and left a comment there http://justintadlock.com/archives/2009/05/06/custom-taxonomies-in-wordpress-28#comment-200736

    This comment asked how I could use custom posts in Wp 3.0 when released for a mortgage comparison site I am planning.
    Here is the question and the variations possible for a home loan in Australia.

    “How would I best use custom posts and taxonomies on this site? [Why did you elect to go for non hierarchal taxonomies.]
    Most people only focus on interest rates.
    Loans however could be classified by, Funder, loan size, down payment, lender, lender type, distribution channel/s, loan type, client type/ employment stability, income and job type/ partners/ downpayment, mortgage insurance [variable on deposit amount] loan purpose, loan costs, Property security, loan size, Interest fixed or variable or combo/ revolving credit line, Repayment options, Loan style, Loan options, Interest rates, Introductory discount offers, Loan terms, Loan conditions, Early repayment options, application fees, establishment fees, ongoing fees and charges, deferred fees, early repayment penalties, default fees and interest rates, default processes, Loan documention type, Credit rating/history/ scores. etc.
    E.g. Client type could be first home buyer, self employed, with less than two years income/tax statements, with minor credit defaults. In Australia he would be paying a higher interest rate than a professional, such as an employed lawyer on $150,000 with clear credit, and be precluded from applying with many lender types [and or loan types]. Incomes, dependents and financial commitments can also affect the loan offered.
    Each one of these can have a multiple choices, and or be dependent on other areas.”
    Any suggestions would be appreciated.

    Reply
  100. Custom post types in WordPress | Maine Observer
  101. SHW
    SHW Published |

    Thanks a lot for this great explained article!

    If got a question though: Do you know, how I can get the CPT queried by the searchform? Unfortunatelly I seem to fail with everything I try.

    Best wishes,

    Steffen

    Reply
  102. Markus
    Markus Published |

    funny 404 bug :p

    Reply
  103. Gavin
    Gavin Published |

    How do I get the custom post type of the post to show up in the loop? I’ve created a few custom types, and I’d like the type to appear in a dialogue balloon over the thumbnail, so that visitors know they’re getting for example, a Video or a Photo. Cheers!

    Reply
  104. Seth Shoultes
    Seth Shoultes Published |

    My hat is off to you Justin. This is one heck of a detailed tutorial :)

    One of the custom post types I can see myself making is an event listing/information post type. I made a plugin called Advanced Events Registration (http://shoultes.net/wordpress-events-registration-with-paypal-ipn/) for WordPress that allows blog owners to publish events (including registration forms) to their blog. I also offer a free version, but the pro version of the plugin is actually a full event management suite which also allows you to create a post at the time of event creation. At the moment the new post is created by including a “post template” and a little bit of ob_start() and ob_end_clean() magic.

    I am going to see if I can integrate what you have posted here. This looks like it may be a very promising alternative to what I am currently doing with ob_start() and ob_end_clean().

    Thanks!

    Seth Shoultes

    Reply
  105. The Frosty
    The Frosty Published |

    Wondering if anyone has attempted to import current blog XML or RSS feed into a custom post type, is that possible yet?

    Reply
  106. Michael Wellspear
    Michael Wellspear Published |

    Amazing post! Thanks alot!

    Reply
  107. lukeMV
    lukeMV Published |

    Any easy to understand guides on how to add options to the custom posts? For example, if a movie is drama, comedy, horror…. to have those options as check boxes WITHIN the custom post edit panel? I can’t seem to find a guide or plug-in for that.

    Reply
    1. Gina
      Gina Published |

      I would like to know too…

      Reply
    2. paul
      paul Published |
      Reply
  108. Arvind
    Arvind Published |

    thank you for your post. this is great for me. specially for those who are new to custom post type. thanks again.

    Reply
  109. wawan
    wawan Published |

    wow….. nice posting.. thanks for share.

    Reply
  110. Custom post types in WordPress « Polaraul Web 2.0
  111. Stray Dog Strut » Blog Archive » Wordpress 3.0 is here!
  112. 8 New Exciting WordPress 3.0 Features | Onextrapixel - Showcasing Web Treats Without A Hitch
  113. 8 New Exciting WordPress 3.0 Features | CSS Citadel
  114. WordPress 3.0 custom post types, taxonomies & Thesis — kristarella.com
  115. Create Custom Post Types Easily with the WP Easy Post Types Plugin
  116. All In One SEO in Wordpress custom content type | Andrei Gherasim
  117. HOW TO: Get Up-to-Date on WordPress 3.0
  118. Kevin Tan
    Kevin Tan Published |

    Great post Justin. It’s always good to spice up your blog to separate yourself from the rest of the flock.

    Reply
  119. mezar işleri
    mezar işleri Published |

    It is a good idea to plot the data so that you can explore its features.
    An exploratory plot of your data enables you to identify discontinuities
    and potential outliers, as well as the regions of interest.
    Thanks…

    Reply
  120. A Hard to Notice But Awesome Feature of Wordpress 3.0 | ChurchCrunch
  121. WordCamp@Chicago Recap: WordPress for Clients :: www.fuyuko.net 2009
  122. Jake Goldman
    Jake Goldman Published |

    For those of you asking about / lamenting the lack of custom post type “archives” support (an equivalent to the blog home for a custom post type), I’ve put together a plug-in that plugs that hole in 3.0.

    http://www.cmurrayconsulting.com/software/wordpress-custom-post-type-archives/

    Reply
  123. Richard
    Richard Published |

    I’d be very grateful if you could add a few lines to your tutorial showing how to create a new role and give it the custom post type capabilities. Try as I might I can’t get it to work. In fact, including the capability_type argument WITHOUT a role ‘breaks’ the admin page, simply showing tags.

    A role is definitely needed to make the capability_type argument work.

    Reply
  124. Borneo Ngeblog
    Borneo Ngeblog Published |

    Nice Article,,, Thanks You

    Reply
  125. Loren
    Loren Published |

    Hi Justin,
    I am using the “Content Permissions” component of your “Members” plugin and cannot seem to figure out how to add that feature to a Custom Post Type. How would I do that?
    Thanks!
    Loren

    Reply
  126. Alireza
    Alireza Published |

    i created two post-type (ex. movies and gallery) ,but i need a monthly archive for gallery and monthly archive dont work in gallery, please help me to create a monthly archive for post-type.please!

    Reply
  127. WordPress Custom Post Types And Taxonomies | SNilesh.com -:- Nilesh Shiragave
  128. Benjamin Knight
    Benjamin Knight Published |

    In the page attributes box I see no dropdown for specifying a custom page template for my custom post type. Am I doing something wrong? I have hierarchical set to true.

    Reply
  129. Thesis: How to Use Custom Templates With Custom Post Types
  130. Jordan
    Jordan Published |

    Hey Justin,

    Thanks for the guide. I am having on issue. When I create a custom post type and use it in a category, it does not show up under “yoursite.com/categoryname/”

    How would I go about doing this?

    Thanks, Jordan.

    Reply
  131. WordPress 3.0 Overview – notes | WordPress Austin
  132. An Attractive WordPress Theme Is The LightBright Theme | Online Money Blog
  133. Reading List: July 8th
    Reading List: July 8th at |
  134. Lee Peterson
    Lee Peterson Published |

    Justin,

    How would a conditional statement work with a custom post type in this scenario:

    I have a Staff page with individual Staff Members.

    On the individual Staff Members’ page, I’d like to display a list of their qualifications (via taxonomies) in the sidebar.

    So, in my sidebar.php, I’d like a conditional statement that says “if this is an individual staff members’ page, then display a block listing their qualifications”.

    My roadblock is deciding whether I should be using [code]is_single('staff_member')[/code] or something else. Upon creating the custom post type, the body class returns ‘single-staff’.

    Any thoughts? Let me know if I’ve been too vague or left out important info here.

    Much appreciated!!

    Reply
    1. Lee Peterson
      Lee Peterson Published |

      Well, that took some thinking through, but I figured out why I couldn’t get this sidebar block to show up.

      First, I needed to scroll down in the WP Codex a bit more to find is_singular and how it mentions [blockquote]True when viewing a post of the Custom Post Types book. Introduced with Version 3.0.[/blockquote]

      Then it was just a matter of making sure my other conditional statements above it that use is_single weren’t conflicting. :-)

      Doubt anyone cares, but there it is.

      Reply
  135. Kadrwa
    Kadrwa Published |

    I am using this for product display. My products have sub categories like Main Category -> Sub Category. Do I need to install custom post type for every sub category?

    Reply
  136. A bbPress alternative for WordPress
  137. Practical Use Case for Custom Post Types « Red Letters Studio
  138. Alex Buri
    Alex Buri Published |

    Just wanted to say thanks for a clear and easy-to-follow explanation of how to use custom posts. It’s rare for a beginner like me to be able to follow someone else’s instructions without misunderstanding.

    Reply
  139. Toni L
    Toni L Published |

    Hi Justin,

    Have you figured out how to use sticky posts with custom posts? Would love to know.

    Reply
    1. bineet chaubey
      bineet chaubey Published |

      hi i have also face same problem . how we can add sticky post featured in our custom post type. please help me . i am making a project , in which sticky post featured is essential in custom post type ” review “. please help me

      Reply
  140. Gary Cao
    Gary Cao Published |

    For those who are having 404 error with custom post type, simply flushing the rewrite table upon activation sometimes doesn’t work. You have to first register the post type then flush the rewrite table in the activation hook.

    function my_register_post_type() {
    // code to register your custom post type
    }
    
    register_activation_hook( __FILE__, 'my_activation_hook' );
    
    function my_activation_hook() {
        my_register_post_type(); // this has to happen first before flushing the rewrite rules
        flush_rewrite_rules( false ); // soft flush is enough
    }
    Reply
    1. Andrew Bailey
      Andrew Bailey Published |

      +1 Gary!

      this was making me go bonkers!!

      I had the rewrite in the activation but it wasn’t working so I moved it to after the register_post_type and that worked but I seem to recall that the flush_rewrite_rules is pretty intensive and having it run every time the register function ran seemed silly.

      having the register_post_type function run before doing the flush_rewrite_rules in my activation function did the job.

      thanks! maybe now I can get some real work done! haha

      Reply
  141. Rem
    Rem Published |

    Im having trouble here – Showing multiple posts from our custom post type

    Using query, I can show up to 10 posts on page. But what about the pagination?

    ie, I have custom post type called “Services”, I have 20+ services.

    So specific service url is site.com/services/service-name01
    Ten services will show on site.com/services (I’ve put that code in services.php and used it as page theme by creating a page called services)
    Now I want to show rest of services on site.com/services/page/2 Any way?

    Reply
    1. Gabriel Izaias
      Gabriel Izaias Published |

      @Rem, you can use this to solve the pagination issue:

       'post',
                'paged'=>$paged,
           );
           query_posts($args);
      ?>

      I hope it helps you.

      Reply
      1. Gabriel Izaias
        Gabriel Izaias Published |

        Something went wrong with my comment. Probably because I used .
        Let’s try without it:

         'post',
        	'paged'=>$paged,
            );
            query_posts($args);
        ?>
  142. Mário
    Mário Published |

    A question to Otto, about PODs vs. Custom Post Types.

    If we include the post types in the functions theme, then this will be inherited to the network sites. This means that if I want to have a site where everybody can create their own Super Dupers listings, then all I have to do is make available themes that have that custom post type.

    How does this work with POD? Can I make every user in the network use that post type?

    Reply
  143. WordPress 3.0—Really WordPress 3.0 — Laura Kalbag
  144. Justin Tadlock über Custom Post Types – Koffeinbetriebenes.Net
  145. Branden Silva
    Branden Silva Published |

    Justin do you think you could write up a post on how to properly implement your custom post types to display the data with the title? So a Podcast would have length and speaker listed as categories and those options, when checked, would be displayed within the top view of the Podcasts in wordpress.

    I know its fairly simple but it may be helpful and compliments your above code.

    Reply
  146. Kathyp
    Kathyp Published |

    Maybe its because I’m new to Wordpress but that 404 trick was news to me and has just fixed my custom post type stuff after scratching my head all day. Thank you.

    Reply
  147. Smarter Custom Post Types in WordPress 3.0 | Jay Andrew Allen
  148. Faye
    Faye Published |

    Wonder if you could shed your expert light on this one…I’ve created a hierarchical custom post type called Events, with the intention that any given event (eg Acme Conference 2010) will have several child posts (eg Agenda, Location, Bookings etc).

    However, I can’t work out how to output a list of all the child posts of Acme Conference 2010. The WordPress Codex suggests that they’ve ‘added custom hierarchical post type support to get_pages() ‘, but has anyone had any success in listing out child posts from a hierarchical custom post type?

    Reply
  149. Everything You Wanted To Know About Custom Post Types — ForSite Media
  150. Jason Kadlec
    Jason Kadlec Published |

    Any update on the tutorial on Custom Post types with Taxonomies?

    Maybe I should just go back to the More Fields plugin, but it’s so buggy in 3.0!

    I want to be able to get the posts from my Custom Post type, and then filter those posts by a custom Taxonomy.

    I’ve seen the debate on Otto’s site and the fact is, my client needs a custom UI to data enter. the_title() and the_content() and custom fields are not going to cut it.

    I’ve been using the “more fields” plugin but it’s sooo buggy. Also, I want these custom posts to be always separate from the blog posts. The site has a blog and these posts are not blog posts.

    I can’t believe WordPress can’t handle both queries – one to the custom posts and then by the taxonomy.

    I’ve tried this:

    'XYZ',
      'post_type' => 'Custom',
      'post_status' => 'publish',
      'posts_per_page' => -1
    );

    All the posts from the type “Custom” are pulled, regardless of their being in Custom_Taxonomy XYZ or not.

    What I *really* want is to be able to dynamically set the value of the Custom Taxonomy.

    I do this with posts by matching the category name to the post title:

    query_posts('category_name='.get_the_title().'&post_status=publish,future'.'&posts_per_page=10'); 

    Any chance something similar can be done with Custom Post Type + Custom Taxonomy?

    Reply
    1. Markgt
      Markgt Published |

      Jason, ive had the same problem, and was surprised that Wordpress couldn’t handle it natively.

      I came across the Query Multiple Taxonomies plugin (http://wordpress.org/extend/plugins/query-multiple-taxonomies/).

      so you could have http://www.sitename/custom_post_type/?some_taxonomy=some_value...

      BUT if you had another custom post type with linked to the same taxonomy THEY would show up as well. I managed to get around this by, on the custom post type template (eg: product.php), to only display posts of a certain custom post type:

      // display your content
      ….

      AND MORE importantly, i found that custom post types created by More Fields (or More Types) for some reason can’t handle the custom query. To get around this i used Custom Post Type UI (http://wordpress.org/extend/plugins/custom-post-type-ui/) to create the custom post types.

      Hope this helps somehow. ( Unfortunately i cant paste the code as its for a client. )

      Reply
  151. Markgt
    Markgt Published |

    Arg, the code didnt show up… trying without php tags

    //start the loop here ....
    $isposttype = get_post_type();
    if ($isposttype == 'accommodation')
    // display your content here
    Reply
  152. Justin Tadlock — Jan Boddez
    Justin Tadlock — Jan Boddez at |
  153. Daniel
    Daniel Published |

    I can’t believe that I only just came across this post. This is exactly the kind of thing that would have just cut my custom post type learning curve in half! Thanks anyway for creating a great resource…

    Reply
  154. Chris
    Chris Published |

    Hi,

    I was just wondering if it possible for text area fileds in custom post types to be converted to wysiwyg text editors?

    Reply
  155. Remove Sidebars From Custom Post Types – Thesis Customisation | Daniel McClure
  156. WordPress 3.0 – The Ultimate Roundup For Developers & Users | KreativeThemes.com
  157. Shaun
    Shaun Published |

    “One thing I would warn against is trying to separate your blog posts in this way. You have categories, tags, and custom taxonomies at your disposal if you’re just looking for a way to label them.”

    Justin – Can you elaborate on what you mean by this? Are referring to styling your posts different as something to stay away from with custom post types, and using your existing category, tag taxonomies instead to do so?

    Reply
  158. Custom Post Type 404 Horrors Solved | DroidFox
  159. lorenzo
    lorenzo Published |

    hi Justin, this is quite useful thanks!
    one question which i could not find elsewhere: if custom post types are making wordpress more like a cms and different tamplates can be aplied to different posts, is it possible to have more than one ‘editor’ box which is then rendered in particular divs in the actual theme? (i.e. more like a template skeleton, with editing boxes as a way to edit the content only in particualr sections)

    Reply
  160. Wills Bithrey
    Wills Bithrey Published |

    Hi Justin,

    Great Tutorial :), Just one small issue, I was getting stuck using the is_post_type() function with an error like this: “Call to undefined function is_post_type() in …” on the release version of WP3, and after some searching found that it has been renamed to “post_type_exists()” – Just a heads up to others who might be suffering the same fate :).

    Reply
    1. Ben
      Ben Published |

      Yep, I’m suffering the same fate… ;)

      And still do so, because I want to check at my single.php which one of my 3 Custom Post Types is showing. post_type_exists('custom1') is always true since the “custom1″-Post Type exists.

      Any ideas?

      Reply
      1. Ben
        Ben Published |

        Viewing my Cheat Sheet, the solution is quite obvious…

        In the loop:

        if $post->post_type == 'custom1'

        That’s it. :)

      2. paul
        paul Published |

        thanks Ben, I was doing something more verbous, so that helped!

      3. Jason Kadlec
        Jason Kadlec Published |

        That’s hot. Thanks Ben!

    2. jeeps
      jeeps Published |

      Thanks!

      Reply
    3. Here
      Here Published |

      is_post_type() was changed to post_type_exists()

      Reply
  161. JB
    JB Published |

    Thank you very much for putting all theses information together ! Just a question, can we have template and custom field for taxonomy ? Lets say I have a custom post type ‘MOVIE’ and I want to create a custom taxonomy ‘ACTOR’, can I put custom field to actor, like name, photo, year of birth,….

    Or should I create two custom post type and somehow linked them ?

    Thank you for helping

    Reply
  162. Programmatically Change post_type | Epic Alex :: WordPress Tutorials
  163. Jason F
    Jason F Published |

    I’m really looking forward to the tutorial on combining custom posts and taxonomies, like it appears you did in your movie and book review demos. I just can’t seem to find a good source that explains this.

    Reply
  164. Jason Kadlec
    Jason Kadlec Published |

    I’ve got some permalink issues….visiting the permalink page to refresh the rules will either make page.php work correctly but cause single.php to fail.

    If I set things back to default, and then click from WordPress admin to view a post, then a page, then a custom post type, they will all work.

    Now if I change permalink settings back to year/month/postname (using the % of course) — everything works again.

    Until I add a post to one of my custom post types. Then it all breaks again.

    Any ideas on what could be going wrong? It’s so odd that I can get either single.php OR page.php to while my custom post type is working (single-custompost.php ) but not both.

    Thanks!

    Reply
    1. Jason Kadlec
      Jason Kadlec Published |

      SOLVED. I was using a custom taxonomy named ‘year’. That’s a reserved term it seems so it was messing things up.

      Changed the custom taxonomy to a different name and all is well. (except the hours spent figuring that out!).

      Reply
  165. 8 New Exciting WordPress 3.0 Features « WORLD OF RADZAD
  166. plugin development: add information to posts or make a new db table
  167. techjacker
    techjacker Published |

    How do you avoid the rewrite slug page giving a 404??

    ie: 'rewrite' => array('slug' => 'upcoming-events', 'with_front' => true),

    this URL works: blog.com/upcoming-events/post-xyz
    this URL returns a 404: blog.com/upcoming-events/

    I’ve searched everywhere but can’t find any documentation on this

    Reply
  168. Viewfinder Design » Blog Archive » Book Review Custom Post Type
  169. Jordan
    Jordan Published |

    Is it possible to use plugins like All in One SEO or WP -> Twitter with custom post types?

    Reply
  170. Huw Tyler
    Huw Tyler Published |

    THANKS SO MUCH FOR THE LITTLE PART ABOUT THE 404s! Spent hours checking through code trying to find out why it just wouldn’t work! simple when you know how… thanks!

    Reply
  171. Aldi
    Aldi Published |

    Could anyone tell me how I could retrieve a post-type’s label (plural name) by using the post-type’s name/slug?

    Thanks!

    Reply
  172. Jeffrey Lin
    Jeffrey Lin Published |

    thanks Justin AGAIN! We built so many features based on first your custom taxonomies tutorials and now custom post type.

    first test of custom post type with our (incomplete) stock market dictionary: http://marketheist.com/definition

    Reply
  173. Tutorial Roundup: WordPress Custom Post Types and Automatic Galleries — Creativity Included
  174. kevin
    kevin Published |

    Dude awesome post, a huge help0 and so much new possibilities now with the custom post types and custom taxonomies.

    Thanks a lot.

    ps: i want the book you’ll write!

    Reply
  175. Custom Post Types | poetry4me.com
    Custom Post Types | poetry4me.com at |
  176. Andrew Carter
    Andrew Carter Published |

    I really like custom post types, as it makes it way easier for clients to understand what’s happening (opposed to using custom fields!). I had a lot of trouble getting the “tags.php” page to work after getting custom post types up and running but found a fix. http://andrewroycarter.com/wordpress-2/wordpress-custom-post-types-tags-not-working/ It’s more of a workaround, so I’m really interested to see if there’s a better solution…

    Reply
  177. Janvier
    Janvier Published |

    Awesome Post. I finally got “super dupers” working as videos for my site!

    Thanks for the amazing work

    Reply
  178. James Weaver
    James Weaver Published |

    Thanks for the post, I’ll have to try this out on my themes!

    Thanks Again,
    James

    Reply
  179. WordPress 3.0 new features, Custom Post Types, Taxonomies and Custom Write Panels | nomad-one WordPress Web Designer
  180. Toure
    Toure Published |

    Great post, I will be using this for a small project. thanks.
    But does anyone has an idea about repeating events

    Reply
  181. Popovici
    Popovici Published |

    Hi, I’ve been using your tutorial to create a “job” post type but I got a strange error when I added this line to functions.php:

    add_action( 'init', 'create_my_post_types' );

    The error was “fatal error call to undefined function “add_action”

    Even more wierdly is that, when I took that line out, the error dissapeared, but of course no function was registered.

    Got an idea? Thanks a lot!

    Reply
  182. Gumz
    Gumz Published |

    Hi Justin,

    Thank you very much for the information, it gives me additional knowledge of using the custom post type. I’m glad to be able to search this post. Very detailed :)

    Reply
  183. Custom post types in WordPress | catz
    Custom post types in WordPress | catz at |
  184. Custom Post Types and Recurring Events Coming to Version 3.0.17 | Event Espresso - WordPress Event Registration and Manager Plugin
  185. Leo
    Leo Published |

    Thanks for the info Justin. But I have one question.

    When adding new meta boxes with custom fields for a custom_post_type they show up in the regular Post pages as custom fields already selected.

    Is there anyway to prevent that from happening?

    Thanks!

    Reply
  186. WordPress 3.1 Introduces Custom Post Type Archives — Mark McWilliams
  187. darrinb
    darrinb Published |

    A small detail I noticed is that even though you can set a custom icon for your Custom Post Type to display in the sidebar menu, the default “thumbtack” icon displays when you navigate to the post edit page or the post listing page.

    Like I said, a small detail, but I’m a sucker for consistency. Anyone know of a way to address this?

    Reply
  188. Dealing with Custom post types and categories | Agressivle Oppinated…
  189. How to use custom post types as events | amr ical events
  190. THE BASICS OF BUILDING CUSTOM POST TYPE PLUGINS (PART 1/2) | My Wordpress Developer
  191. Kevin
    Kevin Published |

    Great tutorial, I have been fooling around with them for a while now. This is a great overview!!

    Reply
  192. Custom Post Types in Wordpress 3.0 Links | Jason Lawton's Blog
  193. yashmistrey
    yashmistrey Published |

    hello friends i am having bug, i couldnt find the post in blog
    http://sandesh.makemycreative.in/

    why it’s showing like that “Sorry, no posts matched your criteria”. ?

    please help me ! what should i do ?

    Reply
  194. WordPress as Content Directory: Getting Somewhere « Disparate
  195. Anurag
    Anurag Published |

    I like your tutorial but can you just told me how to display those recent product post on sidebar?

    I little bit confused.

    Reply
  196. Brij
    Brij Published |

    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

    Reply
  197. Matt Hull
    Matt Hull Published |

    I am hoping someone can help me with this, I have created my custom post type, and registered a taxonomy. The custom page is displaying a list of posts, and archive is working, however the links through to individual posts are not. Here is my code from my functions file: http://pastie.org/1318089, and from within my page: http://pastie.org/1318095

    Anyone shed any light on why my links wouldn’t be working?

    Reply
  198. Sandeep
    Sandeep Published |

    hi,
    am trying to setup custom post type “blog”.

    but am not able to create http://www.websitename.com/blog to show all the blogs
    though i have successfully created http://www.websitename.com/blog/post

    how to achieve the same.

    Reply
  199. erick
    erick Published |

    Passion of learning drive me to this site! I hope by visiting this site will encourage my will to keep learning!

    Reply
  200. kevin
    kevin Published |

    hi justin,
    i’m trying to add the ‘custom-fields’ option to the ‘support’ parameter in a custom post type, but somehow this options doesnt want to show up. I’ve tried all the other ones, like ‘author’, ‘excerpt’… they all do show up in the admin, but ‘custom-fields’ wont.

    Have you ever seen this before?

    I already used custom post types in a few wp projects and i’ve never come into this problem.

    Thanks in advance if you have any tip.

    btw, love your site, awesome content you write there!

    Reply
  201. jkinley
    jkinley Published |

    Hi Justin,

    Nice work, but I am left wondering about the php code that you use to register the custom post type and why it differs from what’s used in the Codex. Perhaps you can explain?

    In the codex page they have a $labels array and a $args array. Plus there are other inconsistencies. For example, when listing the labels, they have a ‘_X’ while you use a ‘__’. Can you clarify these differences for a PHP and WP newbie?

    Reply
  202. jkinley
    jkinley Published |

    Never mind. I sorted it out. Keep up the great work.

    Reply
  203. WordCamp Austin 2010 | Pixelita Designs
    WordCamp Austin 2010 | Pixelita Designs at |
  204. Frank
    Frank Published |

    Thanks!

    Reply
  205. The Essential Guide to WordPress Custom Post Type « Bookmark It!
  206. Peter Luit
    Peter Luit Published |

    Hi Justin,

    Does this plug-in: http://wordpress.org/extend/plugins/custom-post-type-ui/ have about the same functionality? I just wondered why this is not basis UI stuff in stead of hard-core-coded stuff……

    Thanks,

    Peter Luit
    The Netherlands

    Reply
  207. Custom post types with Wordpress 3.0 | William Waldon
  208. Where are the best tutorials on using Custom Post types in WordPress 3.0? - Quora
  209. WordPress as Content Directory: Getting Somewhere | Disparate
  210. Custom Post Type in WordPress | Welcome to Business Lync!
  211. santosh
    santosh Published |

    Just one suggestion:
    instead of using add_action( 'init', 'create_my_post_types' ), it is better to use add_action( 'after_setup_theme', 'create_my_post_types' ).

    Reason is in case of ‘init‘ action, create_my_post_types()‘ function will get called every time someone refresh page, and every time code trying to register custom post type, and fails.

    By using ‘after_setup_theme‘ action, ‘create_my_post_types()‘ function will get executed only once time after activating the theme.

    Hope this will be useful .

    Reply
  212. Custom Post Type Archives in WordPress 3.1 « i blog
  213. Live Blogging avec #WP custom post type / taxo » Article » imath..
  214. Magnus
    Magnus Published |

    Hi Justin

    Just finnished the custom post types tutorial, great stuff!

    I´m intrested in customizing the (single view)?

    With some custom feilds that includes video and download link for images ect.

    and maybe float the main picture to the left..

    similar to your example,

    http://popcritics.com/movies/percy-jackson-the-olympiansthe-lightning-theif

    Is it just to style the single-products.php with css-styling and div´s and query the custom fields?

    Best,
    Magnus

    Reply
  215. Alexandre Magno
    Alexandre Magno Published |

    Hey, Interesting you comment about event calendar cause I’m develop one that almost done:

    https://github.com/alexanmtz/wp-agenda

    Great post!

    Reply
  216. MrJysta
    MrJysta Published |

    Great Tutorial Justin!

    Quick question – when the following settings are call at register_post_type:

    'hierarchical' => true,
    'supports' => array('title', 'editor', 'page-attributes')

    I gain the ability to create parent and child relationships for my custom post. However the permalink/ URL structure is not as expected.

    Parent post url:
    mydomain.com/?mycustompost=parent

    Child post url:
    mydomain.com/?mycustompost=child

    Expected url:
    mydomain.com/?mycustompost/parent/child

    Is this just a case of changing the permalinks setting in Wordpress or is this something deeper that has yet been covered when using Custom Posts?

    Please let me know Thankyou!

    Reply
  217. Ashraf
    Ashraf Published |

    Thank you for this! Well-covered article. Will be implementing this soon!

    Reply
  218. Tony Zeoli
    Tony Zeoli Published |

    Hey Justin:

    Quick question.

    I’m having a discussion with some folks on WordPress LinkedIn group who want to have two blogs in one site. They want to use a Custom Post Type for the second blog, and put the post type of Blog2 in the nav menu and return all posts in the second blog there, instead of setting up a network.

    When Andrew Nacin gave his presentations at WordCamp NYC and Wordpress Raleigh, I believe he said that you don’t really want to use CPT for blogging, as that’s what the post type of Posts is for. And, that CPT is better suited for building data rich posts, like your example of a movie database.

    Is it not recommended to use a CPT for Blog2, since you already have a post type called “post,” in the system? Is there a reason not to use it for a second blog on the same site?

    Reply
    1. Michael / South Bay Foodies
      Michael / South Bay Foodies Published |

      Couldn’t you do the same thing with normal posts and a category?

      For instance, create a Blog2 category. In the main blog loop, you would list all posts except posts with category Blog2. Then, in the Blog2 loop, you would filter for posts that ONLY have Blog2 as a category.

      The same thing could be done with the RSS feed to keep the two “blogs” from crossing paths there.

      Reply
  219. Creating a custom functions plugin for end users
  220. Kelly B.
    Kelly B. Published |

    This certainly appears evident in the beginning to separate in completely different post type, however I am as well attempting to comprehend what in addition will I have to do to use them. A couple of things aren’t crystal clear with me at this point, but I have one question. Sharing tags, I made a tag scheme just for this fresh post type, however it isn’t distributed along with pages and posts. Thus far I’ve discovered you can share a different scheme with various post types, however is it possible to share these tags too with different categories as well?

    Reply
  221. How-to: Custom Post Types for Events (Wordpress) | Noel Tock
  222. Custom Post Types and Taxonomies | Adventures with Wordpress
  223. Ivan Gonzalez
    Ivan Gonzalez Published |

    I have not yet coded something with custom post types, i’m currently reading and trying to figure out how give the blogs users a interface on the front end to insert new posts or edit their own’s.
    There is no literature about how to get a working front end with custom post types, or at lease i’ve not found it anywhere in english nor spanish.

    Please could you give us some light about that, or how do you implement it?

    Thank you very much for all your efforts to continue always giving us valuous information!

    Reply
  224. The Frosty
    The Frosty Published |

    You should modify is_post_type to the current get_post_type() == 'post_type'.

    Reply
  225. Arrow Root Media » New Directors / New Films
  226. Robert
    Robert Published |

    Very userfull, helped me alot!

    Thanks

    Reply
  227. EVOL.reverse — Week 4 – Exploring Custom Post Types
  228. Week 4 Assignment | P2PU WordPress Assignment
  229. elmalak
    elmalak Published |

    Hi,
    I really need your expertise on this.

    I am trying to recreate an html site into Wordpress and I need to keep the exact URLs.
    I used html on pages plugin and it worked just fine with pages.

    For custom post types, I used Custom Post Permalinks plugin to give them a .html extension, but I keep getting 404 Not found errors.
    I tried to follow your advise by visiting the Permalinks page, which used to work at first but not anymore.

    Any ideas on what could solve this issue?

    Much appreciated,
    elmalak

    Reply
  230. Wordpress 3.1 | Jeremy McLean
    Wordpress 3.1 | Jeremy McLean at |
  231. Michael / South Bay Foodies
    Michael / South Bay Foodies Published |

    “Given enough free time, I could write a book on using custom post types.”

    I just ordered your new book! I’m hoping it has a chapter or at least a few pages or more on the topic of custom post types! Otherwise, I’ll be praying that you get more free time! :D

    Cheers,

    Michael

    Reply
  232. Ray Gulick
    Ray Gulick Published |

    I found a lot of articles dealing with custom posts, but this one is the mother of all custom post articles.

    I have one final (hopefully) issue I’m not sure how to deal with. I can hack the custom post single template to fix, but hoping there is an easier fix in the functions file:

    When I get to the individual news item (single-news.php), “News/Events” in navigation is not identified as the ‘current_page_parent’. Instead, the blog navigation item carries that class. Is there a quick way to make the class appear on “News/Events”?

    Here is the URL of the site I’m working on:
    http://ntischool.evohost-vps.com/

    Reply
  233. Jeff Sebring
    Jeff Sebring Published |

    This is a great reference.

    The possibilities with post types are amazing. I’m looking forward to more features that give developers tools such as these.

    Reply
  234. elmalak
    elmalak Published |

    Hi,
    I’ve used custom post types for my site which is still under construction and it worked quite fine until I upgraded to 3.1.

    Now something really strange happened, when I try to access the the entries of the custom post types I created, I find them not editable and all I can find is a View button, no edit or anything else.

    I created everything using the plugin, WP Post Type UI.

    Any idea what might have caused this.

    Many thanks.

    Reply
  235. Cool examples of WordPress being used for something unusual
  236. Custom Icons for Custom Post Types in WordPress | Photoshop Template, How to & Code
  237. Josh Chernoff
    Josh Chernoff Published |

    I have found many examples of how to register the custom post type but almost nothing for best practices on how to show the custom post type, even more specifically how to show custom post type from a plugin with out changing or adding to a theme.

    I have an example of a plugin that I found that does what I want to learn how to do. Below is the link to a events plugin that does not require you to add anything to your theme though it can show the custom post type just as if it was a custom template in your theme.

    link: http://codecanyon.net/item/events-calendar-pro-wordpress-premium-plugin/109301

    The plugin registers the custom post type “events” and then “with out adding any files to the theme folder” shows the custom post type “events” in a loop the when you go to the events slug url and also shows the event single post too. All the while never once needing to add anything to your theme folder making it the best way to use Custom Post types in a plugin which are not dependent on modifying your theme to work.

    I like this approach since if I was to make a plugin that used custom posts I would not want the end user to have to upload or move files to their theme folder. I would want the plugin to show the content by inheriting the header and footer of the current theme and injecting my content into the loop or content.

    The question in short is “how do I show the custom post type content from a template that lives in a plugin folder?”

    I have seen use of hooks and filters like template_include and the_content but there is really no good tutorial for that. I think if there was a tutorial that would help most people who are trying to show their custom post type content since it falls into a common use with plugins more then with themes. Plus even with themes showing the content is just about the hardest part for most people regardless.

    Thanks
    - Josh C

    Reply
  238. Greg Turner
    Greg Turner Published |

    Really great article. I’ve created 2 custom post types with their own meta data types for a client. Now I have run into a roadblock that I should have thought of. I installed All In One SEO Pack and it does not support my custom post types. Big problem. Does anyone know of some similar to All In One that supports custom post types? Maybe I will need to hack into All In One, or if nothing works, I’ll have to remove the custom post types and go back to regular posts with categories.

    Reply
  239. Piet
    Piet Published |

    @Greg – If you “only” need AIOSEO for the titles, meta description and meta keywords, then you can also do that for the custom post types by yourself.

    I have just done that on my own site too where I have 2 Custom Post Types working, Testimonials and Projects.

    I use the Custom Post Type title as the title, the excerpt as the meta description and the tags as the meta keywords.

    Please have a look at the code at http://pastebin.com/7fqRurDz

    (you will need to adapt it to your wishes, all the sources are mentioned)

    Reply
  240. Luca
    Luca Published |

    good guide!

    Reply
  241. Max
    Max Published |

    Awesome review! Thanks.
    Just upgraded to WordPress 3.1.1 and going to use this ‘custom post types’ too.

    Reply
  242. Add Settings Page To WordPress Custom Post Type
  243. Jb
    Jb Published |

    Excellent post. But what about that “ticket system” you’re talking about. I’d love to know more about it since it’s exactly what I need for my blog – a simple ticket system for my users.

    Reply
  244. Edwin Bradford
    Edwin Bradford Published |

    This is such a good tutorial. Starting from scratch its explained everything to me and each time I need to add further features edit I come back and the answer is there.

    Reply
  245. Ori Shmolovsky
    Ori Shmolovsky Published |

    Hi Justin,
    Great tutorial, thanks!
    Is it possible to create a custom post that has more then 1 editor field, I am trying to build a guides blog and each guide has many steps, I want each step to be a “post” so in the admin page there should be many textarea inputs, from my understanding it is not possible and every custom post can have only one editor fields.
    Thanks!

    Reply
  246. Create a Wordpress Sermon Archives with Custom Posts & Taxonomies | Ryan Spilhaus dot com
  247. How to create a WordPress Custom Post Type
  248. Shovan
    Shovan Published |

    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

    Reply
  249. Create separate categories (taxonomies) for each custom post type in wordpress « Christy John
  250. Show the custom posts of a particular category in Wordpress « Christy John
  251. af
    af Published |

    Justin,

    There’s a typo in one of your code examples. THe extra space between the word “category” and the single quote is causing an error:

    'taxonomies' => array( 'post_tag', 'category '),

    Thanks for the great explanation nonetheless.

    Reply
  252. Rutwick
    Rutwick Published |

    Hi Justin,
    I figured it out! I hadn’t duplicated all the capabilities and directly added those 3 meta capabilities, so it wasn’t working! Thanks if you were planning to answer my first comment ;)

    Rutwick

    Reply
  253. Rutwick
    Rutwick Published |

    Sorry, commented on the wrong post when I wanted to comment here… http://justintadlock.com/archives/2010/07/10/meta-capabilities-for-custom-post-types#comment-332608

    Rutwick

    Reply
  254. FAQs and Custom Post Types | Mad9Scientist.com
  255. Pixeldreher
    Pixeldreher Published |

    Great post! Thanks a lot for this good stuff :-)
    Greetings from germany,

    André

    Reply
  256. Tim Mahoney
    Tim Mahoney Published |

    Thanks for this writeup. I’ve been trying to figure out how to get a custom loop going for my custom post type, and this seems to be the way to go. Thanks!

    Reply
  257. The Butterfly Circus – a Case Study on Advanced Canvas Modification | WooThemes
  258. DK WordPress Theme 3.0 | David A. Kennedy
  259. Get the Custom Post Type Slug |Burt Gordon
  260. viking
    viking Published |

    Hi,

    May I know how to create a custom post type that is globally activated for all the subsite in the network using Plugin?

    Thanks.

    Reply
  261. nomadone
    nomadone Published |

    Wow once again an really comprehensive guide for the rest of us. I’ve been really enjoying CPT’s and as many having lots of frustrations with them in certain instances but all in all loving CPT’s.

    So much so that I’ve even started using CPT’s for functions other than they’ve been intended which has caused a few developers who are Purists to criticize my use of CPT’s. Whatever

    So wondering if anyone out there has managed to figure out how to hide CPT admin tabs from certain users, eg. anyone lower than admin level? I’ce added a custom post type to a few projects to add some site settings and only want admins to see the dashboard link.

    I aint now plugin developer so usually have to hack my way around doing these kinds of things.

    Once again Thanks for the informative articles Justin!

    Reply
  262. Lisa
    Lisa Published |

    I have a list of regular posts in the category “News” and I’ve also created a custom post type for “Events.” I’d like to list let’s say the most recent 10 posts for each on the same page. I don’t want them to intermingle. Rather, I want first one list to display and the other to display below it. Can I use WP_Query for this with two loops?

    Reply
  263. Filip
    Filip Published |

    Thank you for this tutorial. I was searching for something comprehensive and yet simple enough for a person who understands little from codding.

    For it is still a struggle to make something work, but after a whole morning in front of the code I’m finally done with my first custom post types.

    I feel obligated to say thanks because what is one morning compared to lets say one week going through overcomplicated articles and tutorials and digging in the Wordpress codex.

    The only thing that for some reason I can’t make working is the custom post type icon in the admin panel, but that is nothing.

    Reply
  264. Peggy
    Peggy Published |

    Thank you Justin for this usefull and comprehensiv post ! I’m a beginner with wordpress custom and it make it easy !

    Greetings from france,

    Peggy

    Reply
  265. WordPress · Custom Post Types
    WordPress · Custom Post Types at |
  266. WordPress Tutorial - Separate your content using custom post types
  267. Jan
    Jan Published |

    Thanks for sharing. It helped me solve an error in my code!

    Reply
  268. Tom Johnson
    Tom Johnson Published |

    Thanks for the excellent tutorial. Very helpful. There’s one thing I keep missing, though. I have created custom post types on a site and added various labels. I want to make the labels show up on the posts, but they don’t. How do I call the labels so that they appear along with the content?

    Thanks,

    Tom

    Reply
  269. Pak Galaxy - Complete Guide to WordPress 3.0 Awesome New Features
  270. Urban Svensson
    Urban Svensson Published |

    Hi, i know this blog post is rather old but still a good introduction to CPT.

    I have a question: I would like my Custom Post Types to bee full text feeds, with the whole content. This url of course works http://sitename.com/feed/?post_type=name, but I only get excerpts in the feed. Regardless of setting feeds to be full text in Panel Settings.

    I know there is snippets for including the Custom Post Types feed to the main feed. But I want separate feeds to be full content feeds.

    Thankful for help

    Reply
  271. Samual
    Samual Published |

    Is there a way to include post types in the Wordpress archives?

    Reply
  272. Custom columns for custom post types
  273. Jes
    Jes Published |

    Thanks so much for this post. A fantastic Resource.

    Reply
  274. Mike
    Mike Published |

    This is an excellent post! The codex is very lacking on support for custom post types. I was glad to find this!

    Thanks!!

    Reply
  275. grigori
    grigori Published |

    Justin…. Im going to kiss you in excitement!!
    Your tip with “Help! I’m getting a 404!” and “The easiest way to fix this is to simply visit your Settings > Permalinks page.” Worked!!!!!!!!!!!!!!!!!
    Love you! I have been trying to solve this issue for few days… If I ever meet you, Im taking you for a beer…:)

    Reply
  276. Adam
    Adam Published |

    Great post! I really appreciate your clear, step-by-step explanation/tutorial of custom post types. You even knew that I would get an Error 404 page, and had a fix all ready! Thanks so much! :)

    Reply
  277. Steve
    Steve Published |

    Excellent read. I’ve only recently got started using Wordpress and although overall it’s pretty simple to get the hang of, there’ll always be things like this which you learn on a continuous basis. Thanks.

    Reply
  278. Jatin Soni
    Jatin Soni Published |

    First thanks for this tutorial..

    Second can you please paginate your comment..

    Third your tutorial is nice in detail but its not for newbie like me..you haven’t describe step by step process how and where exactly we should put the code so its hard to get the result with it.. I am in need for some step by step guide and would really appreciate if you can do..

    Reply
  279. Momekh
    Momekh Published |

    OK, so maybe you’ve heard about this?

    I create the custom post type, and now my media library is all wonky.

    Read up on some helpful entries, there is an entry on trac on how we shouldn’t use ‘type’ as that’s a reserved term etc. But I am NOT using type. I was using ‘tag’ to register a tax for the post type, I even tried changing that. Still, the gallery doesn’t show up (it tells me the # of images etc, but doesn’t show the images, hence I can’t add images etc from the gallery).

    What gives, o mighty Tadlock?

    Reply
  280. Momekh
    Momekh Published |

    Wow. Couldn’t believe the solution was this simple; reminds me now why coding always seemed hard!

    The problem was NOT with custom post types, but when the post-thumbnail activation was called within the theme.

    I checked the twentyeleven code (as their featured image etc was working), and God bless their souls, the comments had this to say:

    Note that this function is hooked into the after_setup_theme hook, which runs
    * before the init hook. The init hook is too late for some features, such as indicating
    * support post thumbnails.

    Now I hooked the thumbnail support into after_setup_theme and it works. Feels like I just climbed Everest (although I haven’t) :P

    Thanks anyways man. God bless :)

    Reply
  281. B.J.
    B.J. Published |

    Well,

    I’m not a PHP geek or Developer but i could follow it pretty nice step by step.

    Only one question..

    Will it be possible to add a category option to the back-end of this Custom Post Type ?
    If we could, i think i could make a better and easier to use CMS for a friend who has no idea about building websites and working with them. So WordPress will be very new to him and it will be his first time working at a CMS.

    At this point i have made a 3 way layout for showing off blog-posts.
    Aside, Standard and Gallery Post Formats. All 3 of those Post Formats have their own templates and unique layouts the only problem i face right now is that i can’t change the names of the Post Formats at the back-end. (admin -menu).
    So Gallery will always stay named like Gallery but really this way of posting at my website is something else right now. It has nothing to do with a Gallery-view anymore thats why i would like to rename the Post Formats but WordPress will not let me do this.

    Thats why i was thinking, what if i made 3 different Post Types all with his own unique website layout attached to them, and maybe remove the basic POST option from the back-end admin menu. ??

    That would solve the problem and would make the back-end for this person even easier to use , because he can clearly see the name of the layout (the Post Type) at the menu and start posting at.

    Any idea?

    Thanks,
    Justin..

    Reply
  282. B.J.
    B.J. Published |

    Sorry about my comment above,
    Problem solved..

    I found a little Typo at your tutorial!

    At Taxonomies
    'taxonomies' => array( 'post_tag', 'category '),

    There is a SPACE behind category Thats why they didn’t show up.

    Reply
  283. Shahz
    Shahz Published |

    Hey Justin,

    How do we define custom titles for a custom post type? I’m trying to create a custom wordpress title for all posts made under a custom post. Basically, its a version changelog for an application. I would like to only input the version number in the title field, and the output has to be standardized with a string accordingly.

    My custom post type is ‘custom_version’ and the title output that I’m looking for is “Application has been updated to version “.

    I’ve understood that this can be achieved using add_filter and I’ve tried playing with this code for days now, but I’m not really a PHP Pro so help is much appreciated :) Here’s the code:

    add_filter('the_title', 'new_title');
    function new_title($title) {
        global $post, $post_ID;
        $title['custom_version'] = 'Application has been updated to v'.$title;
        return $title;
    }
    Reply
  284. WordPress Initialization
    WordPress Initialization at |
  285. Paul Schlereth
    Paul Schlereth Published |

    This tutorial really helped, thanks! I was wondering if it was possible to use a variable when passing arguments to WP_Query()? I’ve looked everywhere and asked in the Wordpress forum – to no avail. Here’s my code:

    $myVPname = get_the_title();
    	
    	$vpArgs = array(
    		'post_type' => 'loan_closings',
    		'meta_key' => 'originator',
    		'meta_value' => $myVPname
    	);
    	
    	$vpLoop = new WP_Query($vpArgs);

    When I echo $myVPname I get what I expect but the function can’t seem to get the variable value passed. When I pass a string of the actual value it works – but this isn’t an option for me. Any thoughts? Thanks in advance!

    Reply
  286. Purushottam Kushwaha
    Purushottam Kushwaha Published |

    great tutorial, but i have a query:
    “Suppose I create a custom post type say Form which is composed of few textarea and i want only that to be filled (not title, editor). i.e I want a UI entirely different from default post type(in administrator panel). Can I do it using custom post type API or its different thing i need to know. ”
    Please help. Thanks in advance!

    Reply
  287. Lee Fuller
    Lee Fuller Published |

    by far the best Custom Post tutorial (walk through) I’ve come across, information is clear and super easy to follow… thank you for sharing…

    Reply
  288. Create Custom Post Types and Taxonomies on Wordpress | Abigail Abanilla
  289. Andrei
    Andrei Published |

    Is there a way to auto-increment the custom post order? I don’t want to start from 0 every time I add a new custom post or to manually write the order in the specified input. Thanks.

    Reply
  290. Custom Post Type Blog Roll for WordPress : Steven Winterhalter
  291. WordPress Meta Box Tutorial - Advanced | WP Roots
  292. gabu
    gabu Published |

    Hi,
    Justin I have created a new custom post type named ‘programs’
    & my permalink has been set as /%postname%/
    & I m getting url like localhost/wordpress/programs/english-course-marketing-sales/
    but I want to remove the programs{%custom-post-type%} part,
    IS that possible in anyway ?
    & how can I delete a custom-post type & remove all its instance from my database ?

    Thanks in advance.
    gabu.

    Reply
  293. Sam
    Sam Published |

    Very nice and will come in handy in the theme I am developing. Thanks a million mate :)

    Reply
  294. John Whyte
    John Whyte Published |

    Wordpress never ceases to amaze. I love the wordpress community, you guys are so amazing and helpful.

    Reply
  295. Create a custom "Download" post type using WordPress
  296. Mike
    Mike Published |

    Nice article, man, thanks.

    One question—any idea how to append file extensions to custom post types?

    Reply
  297. Top 10 Resources for Getting Started with WordPress Themes
  298. Top 10 Resources for Getting Started with WordPress Themes | My Blog
  299. yash
    yash Published |

    how to add “sort post terms” in search or archive pages ?

    for example http://goo.gl/K9sXz

    more example : http://goo.gl/SjYjs

    Most Commented | Most Recent or Alphabetical

    how to do this ? please help me

    thanks in advance :)

    Reply
  300. WordPress Custom Content: Refresh So Fla + WordPress | Papasoft
  301. Custom Post Type Pagination Chaining Method | Wptuts+
  302. Mark Simchock
    Mark Simchock Published |

    Very helpful, thanks Justin.

    How can I get a list of registered taxonomies for a specific post type?

    My need/idea is as follows. I want to target content (e.g. banner ads, related articles, a testimonial, etc., whatever) as tightly as possible. For example, if I’m displaying a post W and Taxonomy Y and Term Z , but different content for custom post type X and Taxonomy Y and Term Z.

    I reckon I can build a UI to assign “flags” to each of those intersections. However, I do not want the UI to list intersection that can not exit. That is, if a taxonomy is not resisted to a particular post type then I don’t want to configure it.

    I’ve been looking for an answer for a couple days now. I can get all taxonomies across all post types. I can get the taxonomies/terms assigned to a particular object (but WP wp_get_object_terms does not seem to differentiate between no term assigned to that taxonomy and the taxonomy not being registered for the object ).

    What I can’t seem to get is which taxonomies are registered to each post type. Maybe I’m going to have to define those relationship manually? Really :(

    Help?

    Reply
  303. Dasha
    Dasha Published |

    Hello Justin,

    Thanks a lot for the article, it’s very useful.

    I’ve added a new Custom Post Type and specified my own capability_type argument as following:

    ‘capability_type’ => array(‘internal_job’, ‘internal_jobs’),
    ‘map_meta_cap’ => true,

    I was expecting this will automatically grand admin roles all the capabilities of the new CPT, but it hasn’t. Is this behavior correct? How can I easily add all capabilities of a CPT for admins?

    Many thanks,
    Dasha

    Reply
  304. Andrea
    Andrea Published |

    I’m having problems with permalinks using subcategories in taxonomies.
    Everything works perfectly until the moment I need to do a subcategory.
    I use the plugin “Custom Post Permalink” just to create the permalinks.
    But does not work with the subs, does anyone have an idea of ​​how to do this?
    Thanks

    Reply
  305. My Stream » Custom Post Type Pagination Chaining Method
  306. Justin House
    Justin House Published |

    What’s up Justin,

    It was easy to create a custom post type with your tutorial, thank you.

    While I know how to add custom fields and post types, do you know of a simple way to offer image uploads for custom fields? I don’t want to use WordPress “Featured Image” or the other WordPress image upload to because they’re too trivial for my target users.

    Right now I’m using Magic Fields to handle the image upload process, as it’s very straight forward. You can see it in action here:
    http://wp4re.com/wp-content/uploads/2011/05/GG_AndO_Admin_Screenshots_4.jpg

    I’m trying to go straight WordPress custom post types and custom fields, thus discontinuing MF, but I’m hung up on the image upload part. Any suggestions?

    Thanks.

    Reply
  307. Implementing Custom Post Types with a Custom Plugin | David Sullivan
  308. A Free wordpress newsletter » WordPress Custom Post Types Tutorials, Tools & Advice
  309. Graham Armfield
    Graham Armfield Published |

    Hi Justin, a fabulous article on custom posts which really helped me a lot.

    I have one thorny issue that I haven’t cracked yet which maybe you have – which is how to make the parent of my custom posts a regular page in my WordPress site.

    I have a series of events which suit being classed as a custom post type. I want to have a custom post for each event but to make them children of a ‘normal’ WordPress page – called Events.

    I’ve registered the custom post type with hierarchical set to true and capability_type of page. I’ve also included ‘page-attributes’ in my ‘supports’ array.

    The events are entered using a form on the site which when submitted uses wp_insert_post to insert the event ‘post’. They are inserted with a ‘post_status’ of ‘draft’ so that I can review them before publishing them. At this point I am trying to set the ‘post_parent’ of the custom post to the ID of the Events page.

    The event posts are inserted fine but the parent relationship is not apparently established. When viewing the event pages the parent ID is 0 – so the breadcrumb on the page makes no sense.

    Have you come across a solution for this?

    Cheers Graham

    Reply
  310. Notes from the WordPress Austin meetup 10/4/11 – Custom Post Types | ClarkLab
  311. Notes from the WordPress Austin meetup – Custom Post Types | ClarkLab
  312. WordPress Meetup: Q&A - WP Austin
    WordPress Meetup: Q&A - WP Austin at |
  313. Zhenjiazhibao
    Zhenjiazhibao Published |

    Hi, I have a problem, I hope you can help me.
    For example, I don’t want add new custom post of permalink by %name%, just by %ID%. I had setting the Settings > Permalinks like “/archives/%post_id%”. but it’s useless.
    Thanks

    Reply
  314. Advanced Layout Templates In WordPress' Content Editor
  315. Removing Edit Permalink/View "Custom Post Type" areas | SeekPHP.com
  316. Advanced Layout Templates In WordPress’ Content Editor | kabayview.com
  317. Advanced Layout Templates In WordPress’ Content Editor | Designer Malaysia
  318. Custom post type presentation and resources | Advanced Web Development
  319. jeff
    jeff Published |

    THANKS Justin, so well-presented and valuable info.

    I was wrestling with this all night, could not figure out why it wasn’t working kept getting the “404 Error” after each go around and would go back and tweak the code… had an inkling I needed to flush something…

    Then I Googled and found this page and your one piece of simple advice:

    Help! I’m getting a 404!

    “The easiest way to fix this is to simply visit your Settings > Permalinks page. You don’t have to save your permalinks but just visit the page. This will flush your rewrite rules.”

    You might want to mention this earlier in the post (for people who freak out like me when they see this error)

    Again, thank you for this. Much appreciated!!

    Reply
  320. Site Journal 2011-11-13 | yosolosoy
    Site Journal 2011-11-13 | yosolosoy at |
  321. Denis
    Denis Published |

    Hi Justin,

    I try to set up a little magazin. So I created some Custom_Post_Types like CDs, DVDs, Books. And I create some taxonomies like, Artist, Publisher, Label, Author.

    Thats all clear, to me.

    But now, It comes to my already created categories, that I use as Navigation, created by WP.

    Is this still nessesary to use categories? This ist not clear to me.

    This means, I create a new CD (Custom Post Type) Select the CD category, give it some tags and the needed taxonomies.

    I ask, because, my Custom Post Types wont show in the category.php so, I can directly create pages that display the custom post types.

    I cant find the link :-(

    Cheers
    Denis

    Reply
  322. eloubet
    eloubet Published |

    Excellent tutorial, thank you !
    I’ll get a look at your books when they come out.

    Reply
  323. Nicole Froehlich
    Nicole Froehlich Published |

    I read this post and learned a lot but I am having some slight issues with something and hoping maybe you could help me. I need to request feedback from one of my customers on a blog before I publish it and I have never used the custom fields for this, there has always been a box with discussion or feedback options, but I need to get this blog approved. What is the value to put in the “draftfeedback_requests” custom field in order to make sure that my customer has a chance to review the blog before publishing? If you could email me with the answer that would be awesome and I really appreciate it.

    Reply
  324. Removing Edit Permalink/View “Custom Post Type” areas | Q&A System
  325. aleks
    aleks Published |

    Thanks alot!

    Nicely written, easy to understand, well covered, and definetly something that will be helping me in future, and current projects for that matter.

    Thanks again, and keep up the good work, you just got yourself a fan. :D

    Reply
  326. Bas
    Bas Published |

    Nice article. But I now have a problem ;)

    I added succesfull two custom post types. But now the meta boxes and other fields (support) of the page and post (standard post types) are gone.

    Do you know what I did wrong?

    Reply
  327. Francisco Valverde
    Francisco Valverde Published |

    Thanks Justin, very great and clear explanation about custom post types… I am at the moment experimenting with them. I would love if you could also write us about the ‘post formats’, which were introduced in wordpress 3.1. There seems to be some confusion on these…

    Thanks anyway.

    Reply
  328. Leia
    Leia Published |

    Hi Justin,

    I wonder whats the difference between your member plugin and Wp-members plugin?

    Your sounds so great!!!!

    Reply
  329. Ashlife
    Ashlife Published |

    this is really wonderful.. leme see what i can come up with this..

    Reply
  330. Gull
    Gull Published |

    hmmm a v nice tutorial man i like i was very afraid of writing custom post types……ur tutorial gives line by line description of it,,,,,,my seniors guide me but not in such details……so thanks budddy …and best of luck and well wishes for ur life

    Reply
  331. Rai
    Rai Published |

    This is so awesome.
    There is one extra espace on:
    ‘taxonomies’ => array( ‘post_tag’, ‘category ‘), at the end of category.

    Thanks for do this article!.

    Reply
  332. WordPress 3.0 Overview – notes - WP Austin
  333. tsdiokno
    tsdiokno Published |

    I’m really glad WP already allows custom post types.

    And this article really helped me a lot in getting started with them!

    Awesome!

    Cheers!

    Reply
  334. jenson
    jenson Published |

    i’ve been search on google till i been here. I have a problem with my wp permalink structure, specially for “attachment”. there an image i upload to my article, and the image will shown in gallery page, so the permalink result is : domain.com/bla-bla-bla.html/attachment/image-1

    So, my question is, how to remove the “attachment” word on permalink structure. Fyi, i’m using WP version 3.3.1.

    Reply
  335. WPSmith | Helpful Links
    WPSmith | Helpful Links at |
  336. Mark Simchock
    Mark Simchock Published |

    Hello Justin – Great post. It was/is a big help. Thanks.

    I’m running into a perplexing problem and I hope you have a moment to help.

    I wrote a plugin/widget that is best described as CMS Lite. In short I create a custom post type and then use a shortcode to insert content from the custom post content into a standard post/page.

    For example, I can maintain a list of “Recommended Articles” in one of my my_custom_post_type rows and then shortcode that content into any post or page. If I update the entry in my_custom_post_type it then “updates” all the shortcodes. Makes sense, yes? It’s very handy. Tons of cool uses when you think about it.

    The problem is that when I use a plugin (e.g., http://wordpress.org/extend/plugins/sociable/) that uses add_filter( ‘the_content’, ) the my_custom_post_type also get appended to by the plugin. For example, I get Sociable share icons on the main post (as desired) but also on my shortcoded inserted content which makes me unhappy.

    Might you have a suggestion / recommendation on how to stop this?

    Here’s a link to my plugin / widget if you’d like to have a look. Of course if you want to spit some WP knowledge at me about it, please feel free. I did buy your WP plugin book. Unfortunately, it didn’t come with any free time and I’ve been too busy to order some. Hopefully soon ;)

    http://chiefalchemist.com/wordpress-plugin-ez-widget-1-v0-5-4-beta/

    Reply
  337. Tru Butterworth
    Tru Butterworth Published |

    Hi,

    Is it possible to display only the parent posts in the page-attributes drop down menu in the admin area of your custom post type?

    Reply
  338. stella
    stella Published |

    Great post! Thank you for sharing.
    I”m an amateur in Wordpress. Could you please help me with displaying custom posts? You have mentioned that:
    “WordPress will show the singular view of your custom post types without any extra work. Once you create a new post, you’ll be able to view it by clicking on the View Post link.”
    I do that and I see an empty post. No title, no text, nothing. What might be the problem? I use WP 3.2.1. Thanks

    Reply
  339. chaos-shadow
    chaos-shadow Published |

    In your post you say: “One thing I would warn against is trying to separate your blog posts in this way. You have categories, tags, and custom taxonomies at your disposal if you’re just looking for a way to label them.”

    Does anyone know how to do EXACTLY that? This is what I have been searching the last 2 days trying to do.

    Categories is not enough for me, I want to be able to file my posts exactly to my liking in different areas of my site, not just on the 1 page.

    Reply
  340. Wordpress registar post type (custom post type) « Susan Delgado
  341. WordPress for photographers: do it yourself? | Matteo Vegetti - Travel and Photography
  342. James
    James Published |

    I’m trying to add a custom post to my blog and have set it up to use tags from posts (the default ones). The problem is that my custom posts won’t show up in the tag pages. I can’t find a solution to this, aay ideas?

    Reply
  343. salman
    salman Published |

    wow awesome dud. you are the 1st man those give us complete article reference.
    thnx

    Reply
  344. Nino
    Nino Published |

    Hi, I had a hard time triing to understand if a Custom Post Type could help me for what I’m looking for.
    What I realized is that a Custom Post Type is not a Post, right ?

    Could you just answer to this question, it is very important please :
    my theme inserts shortcode generator in blog posts to do many things. I don’t want registered people to use it.
    Can I create with Custom Post Type blog posts just like if I didn’t use this theme ?

    Thanks
    Nino

    Reply
  345. mark shirley
    mark shirley Published |

    Hi I’m using custom-post-types-ui to create CPT’s with custom fields in. When I use a taxonomy picker or tag cloud I can’t get the custom field stuff to show up, is this usual. I have read about custom post archives but am not sure if its something to do with this. Can anyone point me to some relevant information. Thanks

    Reply
    1. mark shirley
      mark shirley Published |

      I since found that the question from my last posted comment is not possible, but I do have another question what is the CSS to target a template named single-movies.php that I’ve created for a CPT called movies – Thanks

      Reply
  346. some cool links which helps you to make you full programmer | myjunk.in
  347. Noorani Bakerally
    Noorani Bakerally Published |

    Hi, u’re post is great, I’m just running with a little problem. I’m using your tutorial as a walkthrough. Everything is fine when I go on this page, I see the ‘test’ post

    http://localhost/wordpress/super_duper/test/

    However, we I go on this page(following URL) to see all the post of type super_duper, i get a 404 error.

    http://localhost/wordpress/super_duper

    I was expecting to see all the post of types super_duper. Here are my codes;

    add_action( 'init', 'create_my_post_types' );
    function create_my_post_types() 
    {
            register_post_type( 'super_duper',
                    array(
                            'labels' => array
                            (
                                    'name' => __( 'Super Dupers' ),
                                    'singular_name' => __( 'Super Duper' ),
                                    'add_new' => __( 'Add New' ),
                                    'add_new_item' => __( 'Add New Super Duper' ),
                                    'edit' => __( 'Edit' ),
                                    'edit_item' => __( 'Edit Super Duper' ),
                                    'new_item' => __( 'New Super Duper' ),
                                    'view' => __( 'View Super Duper' ),
                                    'view_item' => __( 'View Super Duper' ),
                                    'search_items' => __( 'Search Super Dupers' ),
                                    'not_found' => __( 'No super dupers found' ),
                                    'not_found_in_trash' => __( 'No super dupers found in Trash' ),
                                    'parent' => __( 'Parent Super Duper' ),
                   
                            ),
                            'public' => true,
                            'show_ui' => true,
                            'publicly_queryable' => true,
                            'exclude_from_search' => false,
                            'rewrite' => array( 'with_front' => true ),
                    )       
            );
    }

    thanks

    Reply
    1. Pascal
      Pascal Published |

      Hi, did you fixed your problem? I have the same issue.

      Reply
  348. How To Use Custom Post Types To Organize Online Marketing Campaigns | Smashing WordPress
  349. jeremy
    jeremy Published |

    Hi Justin,

    How would I modify labels and taxonomies of an existing CPT defined in the parent from within the child functions.php file? (I am using a premium theme and want to override their default labels.)

    I found a few bits on this elsewhere but it just wasn’t clear enough. You always find a way to make these things clear.

    Thanks.

    Reply
  350. asad
    asad Published |

    hi justin can you plz help me to figur out my problem…
    I have a custom post type. The archive page works fine. Clicking into the posts no content shows.
    thanks in advance

    Reply
  351. Daniel Dogeanu
    Daniel Dogeanu Published |

    Well, this is exactly what I needed! If you’re a theme developer and you work directly with the customers, you’ll want to integrate this kind of functionality into the theme! This opens the door for a lot of possibilities! Thank you for your great tutorial Justin! You really offered me a solution!

    Reply
  352. Pascal
    Pascal Published |

    Hi guys,
    I just discovered this post and I was wondering if this is the way to do what I need. I’m trying to build a product catalog. Each product has different options that are common to all products. Example:

    Fruit (fruit_id, fruit_name, fruit_type, etc)
    Option (option_id, option_name, option_color)

    Fruit can have many option assigned to it. What is the best way to archive this.

    Thanks

    Reply
  353. How I Built Code Snippets With Custom Post Types
  354. Wilko van der Ploeg
    Wilko van der Ploeg Published |

    Great article… up until now the best resource on custom post types I could find. Answered most of the questions I still had.

    Thanx

    Wilko

    Reply
  355. Bharat Chowdare
    Bharat Chowdare Published |

    This article clearly explains what a “Custom Post Type” is and how to implement it. +1 for you Justin, thank you from India.

    Reply
  356. mark shirley
    mark shirley Published |

    I have produced custom post types with custom templates and custom fields. I want to create a page to display my CPT’s. Im using a child theme of twenty eleven and have used the code below from the WP codex but I just get a blank page.

    $type,
     'post_status' => 'publish',
     'paged' => $paged,
     'posts_per_page' => 2,
     'ignore_sticky_posts'=> 1
    );
    $temp = $wp_query; // assign ordinal query to temp variable for later use  
    $wp_query = null;
    $wp_query = new WP_Query($args); 
    ?>
    Reply
  357. Matt
    Matt Published |

    Thank you, thank you, thank you, thank you, thank you!!!!!!!!!!

    I’ve been wanting to do this for a while. Spend 20 minutes on your site and everything running smoothly. Seriously you are amazing!

    Reply
  358. sara
    sara Published |

    This tutorial saved me thank u so much for this, it was more than helpful! :)

    Reply
  359. mark shirley
    mark shirley Published |

    Hi Justin – Brilliant article
    I have created a page template. Can I ask a question is it possible to query just
    the post excerpt’s from CPT’s and a link back to the original posts – thanks Mark

    my code at the moment:

    'Movies',
    	'actors'    => 'red, Mr Menu',
    	'order'    => 'ASC'
    );
    query_posts( $args ); ?>
    Reply
  360. mark shirley
    mark shirley Published |

    Hi Justin – I’ve managed to do it with help from the wordpress forumn. All I need to no now is how to get a taxonomy term or terms.

     'Movies' ) );
    if( $query->have_posts() ) : while( $query->have_posts() ) : $query->the_post();
    the_excerpt();
    endwhile; endif;
    wp_reset_postdata();
    ?>
    Reply
  361. My Custom PostTypes Live in MU | Half-Elf on Tech
  362. Parin
    Parin Published |

    Thanks for this awesome breakdown Justin. Appreciate it!

    Reply
  363. Parin
    Parin Published |

    Ok, I’m facing a strange issue now. I can add new posts with my custom post and without any issues, but the problem is with my custom post taxonomy. Whenever I attempt to delete of my terms in my taxonomy, in this case Person, I get an error:

    An unidentified error has occurred.

    If I go back to my Person taxonomy page, I can see that the term is deleted correctly. But, why this error? Any ideas?

    I also notice that when I try to add a new Person to my custom post, there aren’t any errors, but that new person is listed in my category/taxonomy list right away. I’m not sure what’s going on here, so any help is appreciated.

    Thanks!
    Parin

    Reply
    1. Parin
      Parin Published |

      Ok. I figured this out. I separated all my custom post type and taxonomy code in a separate php file, and had a close “?>” at the end of file which shouldn’t have been there. After removing that, everything works fine.

      Cheers!
      Parin

      Reply
  364. Custom post types in WordPress | Web Development Notes
  365. Top 10 Resources for Getting Started with WordPress Themes » iwtacademy.in
  366. Giulia
    Giulia Published |

    thank you! thank you! thak you!!!! the 404 was driving me crazy!!!

    Reply
  367. Liana Mir
    Liana Mir Published |

    Is there any reason it’s bad to use a plugin to register custom post types and taxonomies? Somebody said these didn’t get written to the right place and should only be used for mockups, not actual use, and that worried me, but I’d rather use the WCK plugins if they’re fine.

    Reply
  368. Liana Mir
    Liana Mir Published |

    No. I’m having to do a bunch of stuff to implement. I’m just totally new to PHP coding and anywhere I can shorten my work-time, I want to, especially because I can’t figure out which code is better between the different suggestions on how to register, with verbose public options being buggy, the code generator using verbose and a different markup than your tutorial, and few tutorials actually just showing a single post type with all the markup complete as an example.

    I know eventually this will all be old hat to me, but right now, I’m new and trying not to transform myself completely into a programmer/designer. I just want a site that does what I want and for free.

    Thanks for the tutorials and the answer.

    Reply
  369. Melanie
    Melanie Published |

    Hello I am using a wordpress theme with a custom post “portfolio”.
    I loved the layout so I put all my post in there instead of the usual blog post.
    However, when I checked my sitemap, I realized that all my post in the custom post “portfolio” is not being treated as a page. I mean, they don’t appear on my sitemap.
    Is there a particular settings that make it so?
    thank you.

    Reply
  370. Doc Hudson
    Doc Hudson Published |

    Lately, I’ve been finding circumstances where I need to have my coder change templates and codes in my self-hosted wordpress blog. Being of a different discipline, I can’t explain to my coder how I want things done. After reading this post I somehow got some idea of the coding behind WP, thanks and I’ll point my coder to this page as well. Keep up the good work!

    Reply
  371. Guideline To Use Custom Post Types In WordPress To Organize Online Marketing Campaigns | WordPress Planet
  372. Toni
    Toni Published |

    Despite being 2 years old, this is still an incredibly helpful post. Thank you, you’ve saved me an afternoon of pulling my hair out over inconsistent, scattered official Wordpress docs.

    Reply
  373. Rachael Edwards
    Rachael Edwards Published |

    The major functionality I was waiting from WP 3.0 was Custom Post types. But I still don’t see how to determine exact custom fields for custom type.
    I mean: we create movies database and create custom field “Actor”. Is there a way to only show this custom field when editing custom post type “Movies”? Because when I create a usual post I see “Actor” in custom fields and so on…

    Reply
  374. WordPress Has Advanced Layout Templates | WordPress Planet
  375. Liyingqing
    Liyingqing Published |

    good tutorial,I don’t see a way to do this at first,and then I puzzled out,thanx

    Reply
  376. Custom Post Types: A Great
    Custom Post Types: A Great at |
  377. Alex
    Alex Published |

    Hi,

    I still don’t understand…. I’ve spent some days learning how to do that, an that…and that….. And still doesn’t work….

    I want to make an Event Calendar… every post(event) should have title, description, date, hour, category and location…. I want my events to be sorted by date and then viewed by category(if any event exist)

    Ex: when I click on a date from my calendar, this is what i want to see in a new page:

    Header

    Date

    Cat1.
    Cat1Event1
    Cat1Event2

    Cat3
    Cat3Event1
    Cat3Event2
    Cat3Event3

    Footer

    And when I click to an event, I want to see full description with location

    Can you help me with some link to some tutorials? Or some words? What should I use? What should I need to do?

    All I need is guidance…

    Thank you very much!!!

    Reply
  378. fiefscent
    fiefscent Published |

    is there any way to have a custom taxonomy checkboxes show up as part of the custom meta box in admin? i’ve made a custom meta box show up for apartment for rent listings. my taxonomy is for number of bedrooms. now i want a sidebar with links to 1-bedroom, 2-bedroom, etc. that works with categories. but when i add listings to the property site, i want to be able to enter all my particulars in one custom meta box — with address, price, image, etc.

    so how can i tie the ‘bedrooms’ taxonomy to my custom fields?

    Reply
  379. Marco
    Marco Published |

    Great article, thanks for the explanation!

    Cheer’s Marco.

    Reply
  380. Sally
    Sally Published |

    Is this possible? – a developer built my site and used your custom post types for the classified ads section of the website. He included a ranking system depending on the number of images included. It looks great front end, but when I work with these custom posts backend, the main body of the advert (or post) appears, not in the usual post text field, but in a custom description box. There are 2 of these, one for ads (posts) without images and one with. The ads look great styled for the classified ads pages, but there are 2 issues which I’d like to resolve:-
    Firstly, if you use the search box to find an advert, it brings up the advert title, but nothing else. Is there a way of getting the whole advert to appear?
    Secondly, I have used the query post plugin to put the latest 3 ads on the homepage. But to display the text, I am copying and pasting the text from the custom description boxes into the ‘normal’ post field. I’d like that to be automatic if possible. Also, because of the styling, it doesn’t include the contact details.
    It’s difficult to explain, but can anyone help? I can provide screenshots backend if that helps. Thanks

    Reply
    1. Sally
      Sally Published |

      The website is http://www.herefordequestrian.co.uk if you want to take a look

      Reply
  381. Austin WordCamp 2010 | Pixelita Testbed
    Austin WordCamp 2010 | Pixelita Testbed at |
  382. What Are WordPress Post Types? | WP Ministry
  383. How to Add a Metabox to a Custom Post Type | a2ztechnologies
  384. andre
    andre Published |

    Hi Justin,

    I have been searching for hours to find how to edit a REGISTRATION FORM created using the Custom Post Types UI plugin.

    Here is the page: http://musicmakesus.ca/musicmonday/register/

    In the admin, on that page editor, I see the template that is being used (on the right side under Page Attributes/Template), but I cannot find where to edit, add or delete the fields and information of this “template”. It’s driving me nuts…

    I would really appreciate any help! Where can I find this template/form?

    Regards,

    Andre Lefebvre

    Reply
  385. WordPress Initialization | $("humanshell").net()
  386. How to Create a Custom Post Type Archive Page Using Genesis WordPress
  387. Custom Post Types | Snippets and Notes
    Custom Post Types | Snippets and Notes at |
  388. Shawn Mulligan
    Shawn Mulligan Published |

    This is a great tutorial and I’m very grateful for it. I think I will be using custom post types a lot in future WordPress sites. I’m hoping you have another tutorial or can point me in the right direction to answer my next question:

    How can I connect the custom post types?

    For example, I have teachers and classes. Each teacher has a bio and each class has a description. But, when editing a class or a teacher, I’d like to be able to connect the two. If I’m on the Edit Teacher page, can I get a checkbox list or other list of classes to assign to that teacher? I can’t imagine I’m the first to have this need. Any help would be GREATLY appreciated.

    Reply
  389. Live Blogging avec #WP custom post type / taxo : imathi.eu
  390. Custom Post Types | Loud Feed TV Design and Development
  391. WordPress Plugin Review: Custom Post Types UI
  392. Dealing with Custom post types and categories | zM
  393. Cerita Lucu
    Cerita Lucu Published |

    I was very fortunate to come over your article made ​​me a lot about wordpress.

    Reply
  394. Tim
    Tim Published |

    Hey Justin. Thank you so much for your comprehensive posts. Now I want to remove the parent slug in the permalink of a child post. The child post is of a different cpt than the parent post. So I get example.com/parentcpt/parent-post-name/child-post-name which results to a 404. Switching between permalink structures doesnt help either. Ive tried a number of plugins but they dont solve. Adding 'rewrite' => array('slug' => false, 'with_front' => false) in the register_post_type doesnt help.
    Please give me a functions.php bullet once and for all.. :)

    btw, paginate your comments, the page loads forever.

    Reply
  395. dalbeer
    dalbeer Published |

    how we can add two feature images field …

    Reply
  396. WordPress Plugin Development Course for Designers – Part 2 | gangster.co.in
  397. WordCamp Fayetteville: WordPress Rocks and So Does Arkansas | beth g sanders
  398. How to do damn near anything with WordPress | Stephanie Leary
  399. WordPress Plugin Development Course for Designers – Part 2
  400. The big one oh!
    The big one oh! at |
  401. An Introduction to Custom Post Type - Troy Chaplin
  402. Automatic Custom Post Type Template Names | WP.Autoload
  403. WordPress Plugin Development Course for Designers - Merge jQuery to WP
  404. An Introduction to Custom Post Types - Troy Chaplin
  405. WordPress Plugin Development Course for Designers – Part 2 - Wordpress Knowledge base
  406. Iftekhar Bhuiyan
    Iftekhar Bhuiyan Published |

    Hello Justin,
    Thank you so much for your post. It was really eyeopening for me. What I am really missing is the capability of creating custom “categories” for the post type and display them on the permalink. I have changed my permalink structure as “/%category%/%postname%/” yet no luck.

    This is exactly what I am looking for…
    http://domain/custom-post-type/custom-category/post-name

    How do I achieve this? Please help. Thank you.

    Reply
  407. Yazmin
    Yazmin Published |

    Thank you Justin! This page is an excellent resource for Custom Post Types. Much easier to understand than the WP Codex itself.

    Reply
  408. Building an Admin System in WordPress With Custom Post Types, Taxonomies and Meta Boxes - White Heat Design
  409. orangorangan
    orangorangan Published |

    Hi Justin,

    The post is great! i got my 404 problem solved. I know this might be off the topic, but this still got something to do with custom post type.

    I use survey me plugin and the form just wont work on the custom post type page, but it works on WP posts and pages.

    Should you might have an enlightment for me, considered i already treat you a virtual beer :)

    thanks mate!

    Reply
  410. pulla
    pulla Published |

    It works great but it shows “Page not found” when you click “view this page”.
    I did re-save permalinks on setting. but it doesn’t seem to be working.

    When I put this …

    'rewrite' => array('slug' => 'super_duper','with_front' => FALSE), 

    the title is saying “Page not found” and showing “Hello world page”. it’s wordpress default page.

    Any tips?

    Reply
  411. Syed Faizan
    Syed Faizan Published |

    This is absolutely the most awsum tutorial for wordpress have ever seen ! Hats off to you sir !

    Thanks a bunch .
    May God bless you

    Reply
  412. iMadalin
    iMadalin Published |

    Is there a way in a child theme to alter the ‘capabilities’ for a custom post type initiated in the parent theme?

    Reply
  413. How to Add a Metabox to a Custom Post Type | Wordpress Guide
  414. sh
    sh Published |

    Been reading a lot these last days… but could not get it fixed: Almost everything is working fine (local environment), just added pagination, pagination works, but on page 2, 3, 4, et cetera the meta title tag outputs… “page not found”… the site itself shows perfectly with a couple of posts as intended.

    Would appreciate any ideas. Thanks.

    Reply
  415. Build a custom image slider using a Custom Post Type | Developmentips
  416. Tanya
    Tanya Published |

    Hi, you said: “When creating custom post types, you need to add your code to a plugin file. While it’s possible to do this via the functions.php file in a theme, it is incorrect to do so.”

    Which plugin did you use? Thank you.

    Reply
  417. Aqib Shahzad
    Aqib Shahzad Published |

    Great post! I really appreciate your clear, step-by-step explanation/tutorial of custom post types. You even knew that I would get an Error 404 page, and had a fix all ready! Thanks so much!

    Reply
  418. Custom Post Types in Home Page : by Justin Tadlock
  419. Will
    Will Published |

    Great post. I have a question though – is there a way to have the custom post types show up as posts under the defined author. Right now I am seeing them as the correct author but they are not showing up in the user panel under said author.

    Thanks -

    Will

    Reply
  420. Custom post types in WordPress | Wordpress Workbook | My wordpress note and workflow
  421. Rehan
    Rehan Published |

    Please suggest me where to add the given code in this post.
    And i want to display as category in menu on cliciking it shows all post.

    Reply
  422. WordPress Initialization | Jeremy's Blog
  423. Design & Development of your Wordpress CMS | hesmid.nl test
  424. Design & Development of your Wordpress CMS | My Webdev Log
  425. Daniel
    Daniel Published |

    Thanks Justin, very useful info.

    For those wishing to add pagination to these custom post types, I just found a great little post which helped me alot!

    Reply
  426. WordPress Custom Post Type Guides & Resources - Articles in IT and more | Articles in IT and more
  427. bhupinder bisht
    bhupinder bisht Published |

    one of the best tut i have ever read in my lifetime….. thanx a lot

    Reply
  428. WordPress Custom Post Type Guides & Resources | Pixels Multimedia
  429. WordPress Custom Post Type Guides & Resources | Pixels MultimediaPixels Multimedia
  430. WordPress-based ticketing systems? - Just just easy answers
  431. hhins
    hhins Published |

    Hey Justin,

    I came across this post while trying to find the 100% proper way to display a portfolio with CPTs initialized from a plugin like this ( http://wptheming.com/2011/08/portfolio-post-type-plugin/ ) but struggle with the display aspect: pagination / archives.

    I see Envato has this article, is this still the suggested method?
    http://wp.tutsplus.com/tutorials/custom-post-type-pagination-chaining-method/

    Ideally it wouldn’t even need page templates since I want to create this as a plugin and bundling page templates with it seems a bit…odd but one thing at a time.

    Thanks for any ideas, I appreciate your site.

    Reply
  432. Why custom post types belong in plugins
    Why custom post types belong in plugins at |
  433. Casey Patrick Driscoll | Post to post relationship recap
  434. Andi
    Andi Published |

    one of the best tut i have ever read in my lifetime….. thanx a lot

    Reply
  435. WordPress Custom Post Type Guides & Resources - Articles in IT and more | Articles in IT and more
  436. Post relationships in WordPress: Parent-to-child (one-to-one)
  437. Jenn
    Jenn Published |

    Now, we can use WordPress for almost any purpose. :)

    Reply
  438. Building My Site: Project Custom Post Type | Gaby Molina
  439. My Epic List of Wordpress Resources
    My Epic List of Wordpress Resources at |
  440. ibrahim aydın
    ibrahim aydın Published |

    I found the code I need, thank you very much for your share :)

    Reply
  441. Why Use Custom Post Types? : English Advantage
  442. How To Use Custom Post Types To Organize Online Marketing Campaigns | Smashing WordPress
  443. Sasi
    Sasi Published |

    Hi,

    I want to display product attributes of 2 different product category with the help of conditional tags. But the condition was not working

    bibleplanet.in/?product=i-belong-to-jesus this is a single product page of ‘t-shirt’ product category bibleplanet.in/?product=jesus-3 this is also a single product page of other category but in both category will display the same fields names called “width, height, thickness, frame size” in case of t-shirt i want to display the field names like “large, medium, small ..etc” with the help of custom field suite plugin i implement all these things and i introduce this condition called <?php if(is_product('t-shirt'))
    but condition was not working both if and else part have tables can u have any idea :)
    This is my code:-

    Height:-get(‘height’); ?>
    Width:-get(‘width’); ?>
    Thickness:-get(‘thickness’); ?>
    Frame Size:-get(‘frame_size’); ?>
    Weight after packing:-get(‘weight_after_packing’); ?>

    Extra Large:-get(‘extra_large’); ?>
    Large:-get(‘large’); ?>
    Medium:-get(‘medium’); ?>
    Small:-get(‘small’); ?>

    Can u pls help me

    Reply
  444. deva
    deva Published |

    This is what I was looking for and need for this, finally met also. thank you ..!

    Reply
  445. WordCamp Fayetteville: WordPress Rocks and So Does Arkansas | beth g sanders
  446. kabaygraphics.com » Advanced Layout Templates In WordPress’ Content Editor
  447. onafets
    onafets Published |

    Hello,

    awesome article, is a pleasure to read it.

    I have made my custom type into my photo based blog.

    Now I have a job plugin and I’d like to link the newly created custom post types to the job board specialities.

    Could you please show me how to do it.

    Thanks a lot for your time.

    onafets

    Reply
  448. sepatu class black
    sepatu class black Published |

    Oh… i just know it.. i think post and label on wordpress cant be customize. Oke thanks very well Justin

    Reply
  449. sobat petualang
    sobat petualang Published |

    thnks justin.. i searching on google and other search engine how to Custom post types in WordPress …and finaly i found in this site..

    Reply
  450. How to become a WordPress wizard | Stephanie Leary
  451. 9 Tutorials to Get Started with Custom Post Types in Wordpress | Powerusers
  452. Imtiaz Ali
    Imtiaz Ali Published |

    Very detail info about custom post types in WordPress, thanks :)

    I liked the “Public” type :)

    Reply
  453. Sohail Qaisar
    Sohail Qaisar Published |

    WordPress is a great platform…nice post types :)

    Reply
  454. allskyshop
    allskyshop Published |

    nice one,

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

    Reply
  455. WordPress | Pearltrees
    WordPress | Pearltrees at |
  456. Custom post types in WordPress | আমার ব্লগ
  457. Belen
    Belen Published |

    This article is the real best I’ve ever read on the Internet about everything related to Custom Post Types. Thank you so so much for such this deep explanation (and you said it was just nothing compared to what you’ve liked to explain!) about these secret WP elements and their possibilities :)) I’m starving for the rest of the articles, this is the first one I ended up in. Thanks!

    Reply
  458. Ibnul
    Ibnul Published |

    Hi,

    Nice plugin to use, I’ve installed it and using for my ecommerce site.

    I’ve created menu item “Product” to add product.

    Added some products.

    I am getting default link of each product like ..

    domain.com/product/product-name

    but I’d like to set the permalink as below

    domain.com/category/subcategory/product-name/

    How can I set up like this ?

    Anyone please help.

    Thanks

    Ibnul

    Reply
  459. Advanced Layout Templates In WordPress' Content Editor
  460. WordPress Resources | SMC Graphic Design 67 - Web Design 3
  461. Kingsley
    Kingsley Published |

    Great post, Thanks for sharing

    Reply
  462. How to use WordPress as a CMS
    How to use WordPress as a CMS at |
  463. Adding settings page to a custom post type | Mikha'el's Ⓦ Blog
  464. Pete
    Pete Published |

    H Justin, How would you arrange/apply CPTs, CTs, CFs, Categories and Posts etc for real estate?

    Reply

Leave a Reply

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/Web site in attribution.

Please use your real name or a pseudonym (i.e., pen name, alias, nom de plume) when commenting. If you add your site name, company name, or something completely random, I'll likely change it to whatever I want.

css.php