Blog Post

Default and extra templates with GD CPT Tools Pro

One of the great many features in GD Custom Posts And Taxonomies Tools Pro plugin, is added templates for post types and archives. But, WordPress 3.1 added own post type archives and things changed, causing problems with the templates added by the plugin.

Plugin adds date year, month and day based templates for archives and adds ID based post templates, that, as far as I know will work fine. But, post types templates for archives are a bit of a problem.

For WP 3.0, plugins added type-{post-type}.php and type.php templates support for archives of custom post types posts. WP 3.1 added standard archive-{post-type}.php template and for various reasons, type templates stopped working. Plugin implements several functions and enhancements that don’t play well with WP 3.1 due to conflicted functionality, so last plugin version 2.6.2, added some warnings and more info on how to use the templates.

GD CPT Tools: Settings
GD CPT Tools: Settings

Many users of Pro version liked the idea of custom post types archives and used them with the plugin long before WP got them, and now is the problem compatibility of using both. So, on the plugin Settings panel you see options, and first two are now clearly marked as WP 3.0 options. So, if you use WP 3.1, disable these.

Third option from the top is to add type based templates to WP 3.1, but that is not working as you expect it now. On some installations is OK, but not on all. It all depends on the existing rewrite rules and on some installations is conflicted. I still have no idea why this happens, and I am trying to determine what is happening with WP template loader to cause problems.

Solution to problem is simple, and it involves renaming the existing template. So, if you have custom post type movie, and your existing template is type-movie.php, simply rename it to archive-movie.php. WP 3.1 will now load this template and everything will work, and all the code you already have will be used.

But, I will still try to determine why the loading of additional template for custom post types fails in WP 3.1, and you can expect solution in some of the following plugin versions.

Please wait...

About the author

Milan Petrovic
Milan Petrovic

CEO and Lead developer of Dev4Press Web Development company, working with WordPress since 2008, first as a freelancer, later founding own development company. Author of more than 250 plugins and more than 20 themes.

Subscribe to Dev4Press Newsletter

Get the latest announcements, release digests, promotions and exclusive discounts, and general Dev4Press-related news straight into your mailbox.

This form collects your email (optionally your name) for the purpose of sending you newsletters. Check out our Privacy Policy for more information on how we store and manage your data. We will not send you any spam. Newsletters are sent 2 to 4 times every month.

Latest From The Blog

wordpress happy birthday wordpress turns 21

Happy Birthday: WordPress Turns 21

21 years young and still going strong, WordPress powers nearly half of all Internet websites and is the most used CMS by a large margin over the competition, with a very active development cycle, showing no signs of slowing down.
tutorials wordpress debug mode benefits and pitfalls

WordPress Debug mode: Benefits and Pitfalls

Developers know how to best use debug in WordPress and WordPress WP_DEBUG constant to get through potential problems and bugs their code might have. But, for regular users, using debug mode can be very confusing and cause more problems than it can help solve.
plugins relase corsecurity 1 9

coreSecurity Pro 1.9

coreSecurity Pro 1.9 brings several very important bug fixes (related to the file scanner), several new features related to antispam control, user session management, improvements to the file scanner, and more.

WP Rocket - Make WordPress Load Fast in a Few Clicks
Grammarly - Number 1 Writing App