Post Type Builder (PTB) has been a great tool for non-coders to add custom post types without writing any code. It allows users to build custom advanced sites such as property listing, movie reviews, classified listing, user submission sites, etc. Today we are excited to announce a major update of PTB v2. The new version has added many new features and improvements. It has been improved with better compatibility between the addons and third-party themes/plugins, especially Builder Pro. You can use PTB to add custom post types, taxonomies, and custom fields; then use Builder Pro to design the templates and display the custom fields using the dynamic content feature. This new version is much better than before. We highly recommend you try the update on a staging site before rolling to the live site as it is a major update. If you've built something cool with PTB, please submit it to our showcase or comment in this post. We are planning to feature some user sites created with PTB.

New PTB Demos

We've built a new PTB demo. The new demo consists of 3 sample post types: Property, Movie and Restaurant. You can import them at WP-Admin > Post Type Builder > Import/Export along with the demo posts.

PTB Import Samples

Multiple Archive Templates

The old PTB was limited to only one archive template. Now you can create additional PTB archive templates which you can display them using the [ptb] shortcode. This new feature is extremely useful if you want to display different archive post layouts on different pages.

PTB Additional Archive Templates

Once the additional PTB archive templates are created, you can select them on the [ptb] shortcode generator (requires Classic Editor for the shortcode generator) or write the 'template' attribute manually like the sample below.

[ptb type="property" template="Property Archive2" orderby="date" order="desc" masonry="0" posts_per_page="10" style="grid3" logic="or"]

PTB Additional Archive Templates

Add Custom Fields to Other Post Types

With PTB v2, you can add custom fields to any post type including other custom post types registered by third-party plugins. For example, you can add extra custom fields such as product measurements, materials, etc. on WooCommerce product post type.

PTB Product custom fields

After the custom fields are added to third-party post types, you can use Builder Pro to create templates to display them. You can also display the custom fields with the Advanced Products module's dynamic content feature.

Builder Pro single product template

Generate PHP

If you are a developer and need to export the post types to a child theme or plugin, you can use the Generate PHP feature to export the code. To export the post-type registration code, go to WP-admin > Post Type Builder > Import/Export. Once you exported the code, you can paste them into your child theme functions.php or as a plugin. This feature is strictly for developers with coding knowledge. If you are not a coder, you should use the PTB import/export tool instead.

PTB generate PHP

PTB Field Shortcode

The [ptb_field] is a new shortcode that allows you to display the custom field value in the post. To display the custom field value, write the shortcode [ptb_field] and the name of the custom field. Note that the ptb_field shortcode must be inserted in the post loop to be displayed (ie. the shortcode must be present in the content where the post has the custom field value).

[ptb_field name="field_name"]

You can also use the shortcode generator to create the shortcode. On the WordPress Classic Editor, click "PTB Field", select the post type and then the field name.

PTB Field shortcode generator

Important Changes

  • Extra Fields Merged in PTB
    • The PTB Extra Fields addon has been merged into the core PTB. Now you don't need to install it as a separate addon.
  • Icon Font Removed
    • To improve performance, PTB no longer loads the entire icon font. The icons are loaded as individual SVG icons. If you have custom CSS that uses the icon font, it will no longer work. We can help you fix this if you need assistance, please post on our support forum.
  • PTB Search
    • PTB search result page now requires the [ptb-search-results] and/or the [ptb] shortcode to render the search results. They are like the placeholder where you want to display the search results. Refer to PTB Search documentation for more info.