Associated Taxonomies is a free WordPress® plugin designed to enhance your taxonomy management by allowing you to associate terms within the same taxonomy.
It simplifies term relationships, offering an intuitive way to manage and display associated terms for categories, tags, and custom taxonomies.
- Associate Terms: Add, edit, and save associated terms for any public taxonomy.
- Dynamic Hooks: Automatically integrates with all public taxonomies.
- Shortcode Support: Display associated terms or posts based on term relationships using simple shortcodes.
- Custom Admin UI: Enriches taxonomy term admin pages with a Select2-powered multi-select dropdown.
- Frontend Styling: Ensures associated terms are displayed elegantly on the frontend.
- Download the plugin from the GitHub repository.
- Upload the plugin folder to the
/wp-content/plugins/directory. - Activate the plugin through the Plugins menu in WordPress.
- Enjoy enhanced taxonomy management!
- Navigate to any taxonomy (e.g., Categories or Tags) in the WordPress admin.
- On the Add New Term page, use the "Associated Terms" dropdown to select terms to associate.
- On the Edit Term page, manage associations with the Select2-powered dropdown.
- Save the term to update its associated terms.
Use the [related_terms] shortcode to display associated terms for a specific taxonomy term.
[related_terms id="123" taxonomy="category"]
id: The term ID.taxonomy: The taxonomy name (e.g.,category,post_tag, etc.).
Use the [posts_by_related_terms] shortcode to display posts that belong to a parent term and at least one associated child term.
[posts_by_related_terms parent="12" child="34,56" taxonomy="category"]
parent: The parent term ID.child: Comma-separated IDs of child terms.taxonomy: The taxonomy name.
associated_taxonomies_tax_list: Modify the list of taxonomies where associations are enabled.
add_filter( 'associated_taxonomies_tax_list', function( $taxonomies ) {
return array_merge( $taxonomies, [ 'custom_taxonomy' ] );
});
- Hooks for dynamically adding fields to all public taxonomies:
{$taxonomy}_add_form_fields{$taxonomy}_edit_form_fieldscreated_{$taxonomy}edited_{$taxonomy}
- Admin Scripts: Select2.js for taxonomy term admin pages.
- Frontend Styles: Basic CSS for associated terms presentation.
This plugin uses the YahnisElsts/PluginUpdateChecker library to check for updates hosted on GitHub. Updates are pulled from the main branch of the repository.
- WordPress 5.0 or higher
- PHP 7.4 or higher
Your contributions are welcomed and appreciated! Feel free to:
- Submit issues or feature requests on the GitHub repository.
- Fork the repository, make your changes, and submit a pull request.
This plugin is licensed under the GNU General Public License v2.0.