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?
- Add custom taxonomy fields when creating a new taxonomy
- Creating Custom Taxonomy without mapping to any post type
- Exclude specific slug in ‘get_terms’
- wp_insert_term – parent & child problem
- Widget to display custom taxonomy tag cloud
- Return only the custom sub-term for custom post type, do not echo term-parent
- Get total number of comments from posts in a specific custom taxonomy
- Custom hierarchal taxonomy loses interface hierarchy when selecting parent & children
- Post tags saving as both tag name & tag ID on post update when tags are displayed as checkboxes
- Combine multiple custom user taxonomy in single url
- Adding session variable and/or cookie based on user-selected input
- How to display term description in empty terms archive?
- Display sub-taxonomies based on SELECTED parent-taxonomy
- Checking if a Page has an Associated Term?
- What are terms and taxonomy, how they related to post and how these three are stored in database?
- Taxonomy , subtaxonomy,child taxonomy of a product woocommerce
- Query Posts by taxonomy/Taxonomy Child Custom order
- How can I get WP to build a feed based on multiple taxonomy terms
- Change permalink of post if it belongs to custom taxonomy
- Get pages only with a specific taxonomy
- Share taxonomy between user and posts?
- Make a taxonomy column sortable in the admin?
- How to filter terms from a custom taxonomy by a usermeta value on all screens and templates
- How to obtain the link/URL to the feed of a custom taxonomy?
- get_term_children doesn’t return an array of children terms
- Get taxonomy parent using child slug (from merged taxonomies)
- How to display custom taxonomy images on index.php?
- get_term and get_term_by return null or false, even though term exists
- Display Taxonomy Terms in an option tag with value being the slug
- Modify “View” in admin panel for custom taxonomy
- Get number of post who belongs in two taxonomies!
- Hide product categories and taxonomy terms in menu if empty
- Custom taxonomy forms for user profile
- Query posts by taxonomy with current term
- get the taxonomies terms associated with users
- WordPress thinks my custom taxonomy pages are search pages #seo
- Add Taxonomy Subcategory To Permalink
- problem in taxonomy-{taxonomy}.php pagination
- Adding custom taxonomy in my existing category URL
- Create custom taxonomy and Display in metabox dropdown
- Custom Taxonomy with tax_query
- Override Taxonomy Template
- Get posts in certain Taxonomy terms for the current page url
- Trying to add taxonomy to get_categories() but it’s not working. How to fix this?
- Edit custom taxonomy description programatically
- Get taxonomy name for the current post
- View the complete list of a taxonomy in the navigation menu
- Get name of taxonomies of current page
- Filter through custom taxonomy with an array of taxonomy IDs
- Save values generated via API as taxonomy terms
- Add custom taxonomy as a css class
- Taxonomy page shows category in title
- Query custom taxonomy for category including children
- Taxonomy Overview Page?
- Order taxonomy terms wordpress
- Only display latest custom taxonomy post
- Unable to get the Parent Custom Taxonomy Terms
- How to get the term description in a taxonomy term archive query?
- Unsetting post_tag taxonomy breaks term description for other taxonomies
- Taxonomies on Pages with Custom Formatting
- How to combine taxonomies into URL?
- Why do my quick edits for custom taxonomies not show on the post frontend?
- WordPress REST API – get custom taxonomy category posts
- Prioritise Pages over Taxonomy Term Root Archive, but not Taxonomy Term Child Archives
- Tracking the name of a custom taxonomy
- Add terms to a taxonomy archive from within the same taxonomy
- Show recent posts from a custom taxonomy in wordpress
- Fill New Taxonomies
- how do you pull data from two taxonomies?
- problem : Custom taxonomy template not showing
- Filter “get_terms” query
- How To Create Dynamic Permalink To Custom Taxonomy List of Current Posts?
- Dropdown (with onChange) with custom taxonomies
- generate random slug when adding taxonomy
- How to use two same taxonomy in same post differently?
- Sort Taxonomy List by Custom Values
- Display taxonomy term slugs
- Can I use multi (sub) levels of relation (AND | OR) on custom query?
- How to display custom taxonomy
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- Taxonomy term breadcrumb; how?
- add custom fields in custom taxonomy meta box in wordpress-3.5.2
- How to permanently delete a taxonomy
- Advanced AND tax_query in sidebar with 2 taxonomies
- create taxonomy
- Alternative for is_taxonomy() to workaround theme’s default sidebar
- Get custom taxonomy term url on archive page
- Custom Taxonomy Template Variables Available?
- Display woocommerce product_cat child terms with thumbnails
- query grandchildren taxonomy terms
- Adding new terms to custom taxonomy
- Group custom taxonomies based on tags contained in their posts
- How do I create a term for every value of a post meta?
- Save selected terms in order of custom taxonomy in post
- Add text in custom taxonomy
- How do I check if a post has a term with a particular ancestor/parent?
- Taxonomy entries are spawning copies of existing entries with the new title as the existing ID, since upgrade
- How to enforce a requirement for custom taxonomy
- Change taxonomy key of existing and future taxonomy posts