try init instead of after_setup_theme
function example_insert_category() {
wp_insert_term(
'Example Category',
'friendsof'
);
}
add_action( 'init', 'example_insert_category' );
Related Posts:
- Get Posts by Custom Post Type ,Taxonomy, and Term
- How to limit the number of terms (terms acts like categories)
- How do I list custom taxonomy terms without the links?
- Retrieve single term slug
- Get list of terms of current taxonomy archive for another taxonomy
- Get all taxonomies for all post types
- How to check the terms in single custom post type template
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- How do I display the taxonomy for a custom post type in an array
- Custom Taxonomy Terms in Menu lead to which page?
- How to order taxonomy terms by most recent post?
- Get all posts for custom taxonomy term
- Pages of my taxonomy terms are showing all posts
- Filter Term By Parent Term – Custom Post Type
- Filter By Term Not Working – Custom Post Type
- WordPress add taxonomies/terms list as a menu in archive page
- get_the_term_list() wanting to loop through the returned values
- List custom taxonomy terms
- Display associated taxonomy child name on single CPT page
- Issue On Listing Woocommerce Parent Tag List
- Taxonomy Archive URL + Template
- How to get all taxonomies of a post type?
- Display current taxonomy term when inside custom post type
- Get term slug of current post
- How to list custom taxonomy categories?
- Custom Taxonomy Template Post List with Sort Order
- wp_get_object_terms(): count relative to passed IDs?
- Count posts that have specific taxonomy term attached
- Taxonomy archives based on Custom Post Type
- Get the ‘slug’ of a custom taxonomy
- Custom Metabox with Taxonomy Dropdown – Saving Issue
- Maintaining strict one-to-one association between terms and custom posts
- If on term-page -> get the current term?
- Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy
- Include custom post type in “all posts”
- Creating a function that receives the taxonomy terms that have been changed in a custom post type
- How do I provide a “show all posts” link in a paginated term archive?
- Query Multiple Taxominies Across Multiple Post type’s
- get_post_meta returns empty array for terms
- Custom Post Type Archive Page Filtering
- Get posts by querying taxonomy and certain terms of the taxonomy?
- Custom Taxonomy back-end customizations
- Post count by month of taxonmy term
- How to conditionally redirect to the post from a taxonomy page?
- Suggested Post and Taxonomy structure
- Custom while loop for hierarchical display of a taxonomy
- Display taxonomy terms, child terms and posts in a template
- Use custom walker to add taxonomy terms to main nav menu
- How do I share categories across multiple post types?
- Listing all term items alphabetically / sorting loop
- Output terms for custom post types
- Custom select query for taxonomies that have posts categorized in another taxonomy
- Get parent category id from child category page for custom taxonomy
- How to get only child terms from a custom taxonomy of current post type?
- Hide meta box for everything BUT a certain custom post type
- Custom Post Types Archives and Single Pages not showing custom taxonomy data
- How can I create an automatic drop down menu with my tags?
- Get taxonomy singular name instead of taxonomy slug inside $taxonomy query
- Get terms of a post but only if they’re also the child of a specific term
- Custom taxonomy template list not working (404)
- Use the custom post type archive for taxonomies?
- How to display custom taxonomy term meta on custom post type
- Taxonomy template page not working
- does wp_insert_term link the term to a certain post ID?
- Get posts by category name
- Grab all Custom Posts by multiple taxonomies and terms
- Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- Order posts by taxonomy terms
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- How to display custom taxonomy term specific post?
- Define multiple prefixes for custom post type
- How to associate custom taxonomy terms with custom post type?
- get_queried_object not work in taxonomy page
- Taxonomies are not showing in the category dropdown
- get_the_terms child terms for current post/custom post only
- Change custom post taxonomy values from front-end
- List posts that have the current url taxonomy
- How to transfer categories (default) to custom taxonomy?
- Custom Taxonomy – fields
- Custom Post Type / Taxonomy / Term – what template to use to avoid 404-page?
- Display title of all custom posts from same taxonomy term on a custom post template
- If custom taxonomy exist on post?
- Get category list & taxonomy list from different post type using post id?
- How to get all posts related to a taxonomy?
- Custom taxonomy- only output relevant terms
- Displaying the Taxonomy and a Queried Term on a taxonomy.php page?
- How to create TEMPLATES for TAXONOMIES? What I have to change in this code?
- Custom Post Status & Taxonomies
- Create an additional template page for every term taxonomy
- Prevent repetitive terms in get_the_term_list
- Displaying taxonomy icon outside archive page
- Taxonomy Grid Archive Help?
- Show taxonomies from specific CPT
- insert a taxonomy for a custom post type
- List a custom post type’s posts ordered by nested custom taxonomy
- Author template – separate custom post type by custom taxonomy term for $curauth
- See the process of creating a taxonomy and tell me where I made a mistake
- How to manage a bookstore
- Get all terms assigned to a post from different taxonomies