The best way is to use Advanced Custom Field plugin. It takes away all the hassle to create the fields, and update them.
Procedure could be:
1. Install “Advanced Custom Fields” plugin
2. Create a new field-group
3. Add desired type of field(s)
4. Add this field group to category
Now, you can see your added field(s) on the “Add New Category” or “Edit Category” pages.
Then you can just fetch category object(s) and use this code block to get your field value:
$terms = get_terms( 'category' );
if( !empty($terms) ) :
foreach($terms as $term) {
$fieldValue = get_field('field_id', $term );
}
endif;
This is to get all categories. You can simply use it for a single cat object.
If you’re willing to get your hands dirty with the coding, try this. http://en.bainternet.info/wordpress-category-extra-fields/
Related Posts:
- Using wp_query is it possible to orderby taxonomy?
- How to use taxonomies on attachments with the new Media Library?
- How to add images to taxonomies?
- Can you add the visual editor to the description field for custom taxonomies?
- Check if a post has any term in this custom taxonomy?
- custom post type taxonomy “tag” archive : no post found
- Add custom taxonomy fields when creating a new taxonomy
- Contact Form 7 – Populate Select List With Taxonomy [closed]
- WP REST API no longer supports filter param, so how do I get posts in a custom taxonomy?
- How to display custom taxonomies in posts?
- Get taxonomy names by post id
- Creating Custom Taxonomy without mapping to any post type
- Why is my working Custom Taxonomy not in get_taxonomies array?
- Custom taxonomy hide meta box but show in menu
- display posts with same taxonomy term
- Exclude specific slug in ‘get_terms’
- wp_insert_term – parent & child problem
- Is there a way to disable a term rather than deleting it?
- Widget to display custom taxonomy tag cloud
- Modify Term Update Redirection
- Hook to process a new taxonomy tag before it is created?
- qtranslate-x problem with custom term description
- Resize $term attachment using url
- Templates files for custom post type with custom tags
- Sort Taxonomy List by Custom Values
- Custom taxonomy escaping html attr
- Showing list of custom posts of a custom taxonomy
- Display taxonomy posts
- Show portfolio category slug in url ( if exist)
- Creating a Taxonomy Page [duplicate]
- switch statement for taxonomy content
- Add image to taxonomy and output to homepage
- Change order custom taxonomy
- Looking for suggestions on creating simple database (Help!!)
- How do you search for a post by custom taxonomy?
- Display taxonomy term slugs
- Can I use multi (sub) levels of relation (AND | OR) on custom query?
- How to display custom taxonomy
- Index page of posts tagged with two separate taxonomies
- Child Pages and Custom Taxonomies
- Custom taxonomy – query returns an error
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- Remove taxonomy menu without removing the metabox?
- How to perform a search inside a specific taxonomy category
- Register custom taxonomy from a Advenced custom field option page
- Taxonomy term breadcrumb; how?
- add custom fields in custom taxonomy meta box in wordpress-3.5.2
- How to permanently delete a taxonomy
- Sorting Custom Taxonomy in ASC/DESC order?
- How can i set post_per_page in my taxonamy?
- Exclude 2 in 3 terms of A Taxonomy from all Archives
- Advanced AND tax_query in sidebar with 2 taxonomies
- create taxonomy
- Select default taxonomy on dropdown
- Using wp_query is it possible to orderby taxonomy?
- WordPress Taxonomy Menu
- List of taxonomy archive index page links
- Get Posts with matching lowest taxonomies
- Alternative for is_taxonomy() to workaround theme’s default sidebar
- What is the current page’s Taxonomy?
- Loop custom post type by taxonomy (Category)
- Any way to make custom taxonomy field searchable?
- Get custom taxonomy term url on archive page
- Custom Taxonomy Template Variables Available?
- query posts returns 10 records
- get_terms() – unexpected ‘=>’ (T_DOUBLE_ARROW) error
- Display woocommerce product_cat child terms with thumbnails
- get_term_children specific no id
- query grandchildren taxonomy terms
- Custom Search only for my Custom Taxonomy Page – data
- Insert taxonomy term to different table
- Getting taxonomies specific to categories
- Remove Tag Cloud Words from Custom Taxonomy
- How to add/enqueue Custom CSS for a custom taxonomy page?
- wp_get_object_terms count on taxonomies within an category archive
- Adding new terms to custom taxonomy
- Group custom taxonomies based on tags contained in their posts
- Make custom post type display with custom taxonomy in url
- Prevent random entries in hierarchical false taxonomies
- Exporting CSV of users with custom user taxonomies out of WordPress
- How do I create a term for every value of a post meta?
- Taxonomies starting with a hyphen (minus) to assign B.C. dates to a post
- is_tax not working for custom taxonomy
- Querying posts globally based on custom taxonomy with its own taxonomymeta table
- Add custom display condition to Elementor Theme Builder for custom taxonomy children, grandchildren, and great-grandchildren
- Save selected terms in order of custom taxonomy in post
- How to delete unused terms?
- Add text in custom taxonomy
- How do I check if a post has a term with a particular ancestor/parent?
- Child terms with improper parent in the url should redirect to 404
- Taxonomy entries are spawning copies of existing entries with the new title as the existing ID, since upgrade
- How to get parent and child name in taxonomy page
- How to enforce a requirement for custom taxonomy
- Issue with WordPress Automatically Assigning Terms to Multiple Posts
- Change taxonomy key of existing and future taxonomy posts
- Cannot set custom taxonomies when creating post
- How to call parent and child category name in separate div?
- Taxonomy archives based on Custom Post Types
- Creating a page that will dynamically get posts from 2 taxonomies
- Hiearchical terms structure and performance