$taxonomy = 'training_cats';
$orderby = 'name';
$show_count = 0; // 1 for yes, 0 for no
$pad_counts = 0; // 1 for yes, 0 for no
$hierarchical = 0; // 1 for yes, 0 for no
$title="";
$empty = 0;
$args = array(
'name' => $taxonomy,
'orderby' => $orderby,
'show_count' => $show_count,
'pad_counts' => $pad_counts,
'hierarchical' => $hierarchical,
'title_li' => $title,
'hide_empty' => $empty
);
$cats = get_taxonomies($args);
foreach ( $cats as $cats2 ) {
echo '<input type="checkbox" name="checkbox_id" value="'.$cats2->name.'" />';
echo $cats2-name;
}
Not tested but should work, change the taxonomy name etc 🙂
Edit: Try the new code, using get_taxonomies (the code didn’t know where to pull data from)
Edit2: Changed taxonomy to name:
Related Posts:
- Modify output of wp_dropdown_categories to add term IDs to each option
- How to make HTML select options searchable
- Create multidimensional array of taxonomies
- The Difference Between Hierarchical and Non-Hierarchical Taxonomies?
- Attaching taxonomy data to post with wp_insert_post
- How to get taxonomy term of the current page and populate queries in the template
- tax_query in get_posts() not working?
- wp_set_object_terms() — prevent overwrite?
- Get_term_by only returns one item from array
- How to have “the most used tags” taxonomy always expanded?
- Get parent and first child taxonomy terms?
- Display the number of published posts for each custom taxonomy term?
- Get wordpress taxonomy archive and sort by year
- Search for tags
- Display Post by taxonomy and taxonomy child if exist
- Missing term_id and term_taxonomy_id when adding a term using wp_insert_term() function
- What hooks/filters are there to alter selected terms on post save?
- Filter blog archive by category in URL
- tax_query: What to pass when I want to have all terms?
- Custom Roll/Custom Post Type – Can’t Select Categories
- Trying to list terms of a custom taxonomy using get_categories
- Add a term to an attachment submitted from front end
- Get and loop posts with all taxonomy terms
- Unable to delete a Category and Tag that share same slug
- How do I get the current tag out of a taxonomy?
- I need template for my custom taxonomy term
- Show list of custom taxonomies when another taxonomy is selected
- If search matches taxonomy
- WordPress as thesaurus/dictionnary: what approach?
- Custom taxonomy is crashing Gutenberg
- How to show the category filter that’s shown on the ‘All post’ pages on a custom post type page in the admin area?
- Custom Field as Custom Taxonomy?
- Custom WP Query: force entry for some taxonomy and have others optional
- Using get_posts() with tax_query parameter set isn’t working with attachments
- How to get the top level parent term Advanced Custom Field values in the child terms
- Allow a Taxonomy Term to be Used Only Once Across All Posts
- need to get postthumnails from a post whithin a category custom post type
- Select Query demand excesive resources [closed]
- Individual post. Meta_key, taxonomy or post status for separation?
- Count Published & Draft Posts Associated With Each Term
- Taxonomy archive page WP_Query does not return get_the_permalink() or get_permalink() value
- get_the_term_list – Return links to edit.php instead of link to taxonomy archive template
- benefits of the table ‘wp_term_taxonomy’
- How to sync to custom taxonomies (tag structure)
- How to save a multiple checkbox array into a non-hierarchical taxonomy
- List posts in a category grouped by other categories?
- `get_terms()` with `child_of` and `childless` combined
- is_taxonomy() is not working
- echo term name outside the loop, using term slug
- What are these undocumented arguments for register_taxonomy?
- Dynamic filtering of posts with custom taxonomies
- Sorting tags by name
- get_term_by seems to be failing
- How to return newly added terms when using wp_set_object_terms
- How to update a taxonomy term for a custom post type with auto incrementing number
- Search Media by taxonomy
- Get Taxonomy name from “registered_taxonomy” hook
- Filtering elements by taxonomy slug
- Echo taxonomy name – second level
- In two-category searches, where does WordPress save the title of the 2nd category?
- Show only first child in dropdown
- Get terms in hierarchical taxonomy
- Taxonomy Checkbox Admin Panel
- Related terms – Terms that feature in post of current term
- Replacing a placeholder term with a session variable value in taxonomy filter
- Loop problem – Taxonomy
- How to relate to 2 taxonomy with category
- Taxonomy Dropdown Question
- WP Search using taxonomy terms
- How To Query For An Empty Taxonomy Field
- How do I converge taxonomy category permalinks into one?
- Taxonomy terms are not checked when edit custom post
- Url leading to archive page, no matter what
- Checking if a product ID has taxonomy term attached not working with has_term
- Can I create a tax query to return posts that match two slugs from same taxonomy
- Taxonomy.php inheriting first post
- Display related terms from a taxonomy in an entry
- I want to get term by term_name without taxonomy
- Add specific content to a taxonomy results page
- Set the limit of taxonomy per page
- What is this Query? and why its taking too much time? Any way to optimize it?
- taxonomy terms, inverted
- How to share terms between two taxonomies?
- Taxonomy Rewrite Problem
- Taxonomy terms can’t find posts from archive.php or taxonomy.php
- how to print post tags [duplicate]
- Filtering posts by taxonomy and meta_value
- What to do with shared terms splitting in WordPress 4.2?
- GET Taxonomy ID
- Hiding an Advanced Custom Field based on Taxonomy Field selection
- Non-Recursive get_term_children()
- How do I add tags/taxonomy to images + a query field on page to query ‘albums’ (images with same tag/taxonomy)
- Delete Term via edit-tags.php
- Child Terms not Displaying on the Taxonomy Term Admin Screen
- Description of a sub-taxonomy
- Order taxonomy terms by the frequency of use in the last 30 days
- I need to add new menu item inside the custom post admin menu
- How to orderby Taxonomy Term in a WP Query
- Hiding a tag from display
- taxonomy change to post/page type