| 开发者 | runthingsdev |
|---|---|
| 更新时间 | 2026年1月14日 22:13 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 6.9 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
/wp-content/plugins/ directoryTaxonomy Template: Your Template NameAdd a PHP file to your theme directory with this header comment: `<?php /**
All public taxonomies including categories, tags, custom taxonomies from plugins like WooCommerce product categories, and any custom post type taxonomies.
No. The plugin supports both Taxonomy Template: (recommended) and Category Template: (legacy) headers for backwards compatibility. Your existing templates will continue to work.
Yes. Add this to your wp-config.php before uninstalling:
define( 'RUNTHINGS_TAXONOMY_TEMPLATE_SELECTOR_KEEP_DATA', true );
Make sure your theme has at least one PHP file with either a Taxonomy Template: or Category Template: header comment. The dropdown only appears if templates are available to select.
Yes. Use the runthings_taxonomy_template_selector_dirs filter to add additional directories. Note that subdirectories are not scanned automatically - you must add each folder path explicitly.
add_filter( 'runthings_taxonomy_template_selector_dirs', function( $dirs ) { $dirs[] = get_stylesheet_directory() . '/taxonomy-templates'; return $dirs; } );
Yes. Use the runthings_taxonomy_template_selector_list filter to modify the available templates. The filename is a path relative to your theme root - if using a child theme, it checks the child theme first, then falls back to the parent theme.
add_filter( 'runthings_taxonomy_template_selector_list', function( $templates ) { // Add a template from theme root $templates['My Custom Archive'] = 'custom-archive.php'; // Add a template from a subdirectory $templates['Product Archive'] = 'template-parts/archive-product.php'; // Remove one you don't want unset( $templates['Unwanted Template'] ); return $templates; } );
This plugin is a fork of the original "Advanced Category Template" plugin by Praveen Goswami. It was adopted because the original plugin was removed from the WordPress.org plugin directory due to security issues. Your existing template mappings will be migrated automatically when you activate this plugin. You can safely deactivate and delete the old plugin in any order.