Organize Your Products With Custom Post Types

4 comments

If you have a large website, many products, or just want to better organize the content on your site, consider using custom post types to create a special post type for the products in your store. With the awesome Types plugin you can very easily set up as many custom post types as you want. You can even organize your custom posts hierarchically. For example, maybe you sell sports products and you have a category of Shoes with Men, Women, Boys and Girls as subcategories. Types makes it really easy to set up a structure like that and, along with Cart66, will turn almost any WordPress theme in to a well organized e-commerce site. Here is a quick tutorial on how to get everything working together.

What You Need

  1. Download and install either Cart66 Pro or Cart66 Lite (free)
  2. Download and install Types (free)

Note that there is also a paid version of Types that includes Views which makes it really easy to display your custom post types in various formats and it works with any theme. Views will be especially helpful if you have a large catalog of products in your store. With Cart66 and Types with Views you can literally turn any WordPress theme into a well organized, powerful e-commerce store!

Create A Custom Post Type

In this example we’ll create just one custom post type, but you can create as many as you need based on what your selling and how you want to organize it.

  1. Navigate to Types —> Custom Types and Taxonomies
  2. Click “Add New Custom Post Type”For help understanding all the options take a look at the Types User GuideThe default settings will be fine. For our example we are going to create a “Products” custom post type so enter:Custom post type name plural: Products
    Custom post type name singular: Product
    Slug: products
  3. Click Save at the bottom of the page.Now you will have a “Products” tab in the left column navigation of your WordPress admin (probably under the “Comments” tab)

Create Some Products

Click on Products —> Add New and enter the content for your products. These pages are just like any other page in WordPress so go ahead and make use of image gallery plugins, SEO plugins, or any other plugin available for WordPress that you might want to use to design and optimize your page.

Enable Cart66 Product Selector Box

After you design your page with images and copy describing your product, you’ll want to put your Add To Cart button on the page. By default, the Cart66 product selector boxes are only displayed on the pages that need them. So, when you add a custom post type for your products you will need to enable the Cart66 product selector box.

Since we have just created a single custom post type with the slug “products” open the functions.php file of your theme, scroll all the way to the bottom and add this little function.

If you named your custom post type with a slug named something other than “products” make sure you use the name of your slug here. If you have multiple slugs you can list as many as you want in the array. Just separate the quoted slug names with commas.

Add Custom Post Types To WordPress Menu

The key here is to make sure your custom post type is checked in the screen options settings. Navigate to Appearance —> Menus and click the “screen options” tab in the upper right corner of the screen. Then make sure “products” (or whatever you called your custom post type) is checked. Once checked you will see a meta box in the lower left with all your custom posts. You can then easily add them to your menu.

4 Responses to “Organize Your Products With Custom Post Types”

  1. This article comes at a perfect time. I just landed a project for a relatively large e-commerce website that I’m going to develop in WordPress using Cart66. I’ve been searching for a nice Worpdress e-commerce theme, but not finding anything for a “large” store that I need. That is where the Types plugin comes in very handy. I found a theme that wasn’t e-commerce, but that I can use quite nicely with this Types plugin.

    This is great stuff!! Thanks for the information, it just made my job a lot easier!

  2. I am trying to get the cart66 shortcodes to appear, and I have pasted the code into my functions file but it is still a blank popup. I am using the genesis framework, could this be the issue?

    • nvm, i got it, thanks!

      • Was it related to the Genesis theme? if so, we’d love to know how you fixed it.