How to Add Custom Meta Fields to Custom Taxonomies in WordPress

[agentsw ua=’pc’]

Do you need to add custom meta fields to custom taxonomies in WordPress?

Custom taxonomies let you organize your content beyond categories and tags. Sometimes it’s useful to add additional fields to describe them.

In this article, we’ll show you how to add additional meta fields to the taxonomies they create.

add custom meta fields to custom taxonomies in wordpresss og

When Should You Add Custom Meta Fields to a Custom Taxonomy?

When you create new content on your WordPress website, you can organize it using the two default taxonomies, categories and tags.

Some websites benefit from the use of custom taxonomies. These allow you to sort your content in additional ways.

For example, a website that posts book reviews could add the taxonomies ‘Subjects’ and ‘Authors’ so that visitors can quickly find the reviews they are interested in.

For more information, see our guide on how to create custom taxonomies in WordPress.

Each taxonomy has only three or four fields by default: name, slug, parent (if it is hierarchical), and description.

Taxonomies Have 3 or 4 Fields by Default

Sometimes it’s useful to add additional fields to better describe the taxonomy. For example, you might add a ‘year of birth’ field to an ‘authors’ taxonomy.

With that being said, here’s how to add custom meta fields to custom taxonomies in WordPress.

Adding Custom Meta Fields to Custom Taxonomies in WordPress

First, you need to install and activate the Advanced Custom Fields plugin. To learn more, see our step by step guide on how to install a WordPress plugin.

Next, head over to the Custom Fields » Add New page. Here you can add a field group that contains one or more new fields.

You will be asked to give the field group a title, and this will be displayed along with the new fields when adding or editing the taxonomy. In this tutorial, we want to add a custom field to the Authors taxonomy, so we’ll name the field group ‘Author Details’.

Add New Field Group

Once you’ve done that, you should click on the ‘+ Add Field’ button to add a field. A new form will appear where you can fill in the details of the new field.

Once you enter a field label, the field name will be created for you automatically, and you can edit it if you like. You will need to use the field name later in the tutorial, so make a note of it.

Add New Field

Now you should fill in the other details for the field, such as the field type, instructions for your authors who will be filling in the form, and whether this field is required. Other options not shown in the screenshot include default text, placeholder text, character limit, and more.

If you wish to add a second field, then you should click the ‘+ Add Field’ button and repeat the process. Otherwise, simply scroll down to the Location section.

Here you can create rules that describe where to display the new field. You should select ‘Taxonomy’ from the first drop down menu and leave the middle field as ‘is equal to’. Finally, select the correct custom taxonomy for the last field. In this tutorial, we’ll select ‘Author’.

Custom Meta Field Location

If you want to add this field to another taxonomy, then you can click the ‘Add rule group’ button and repeat the step.

Now you should adjust any other settings on the page. We’ll simply leave the default values. Once you’re finished, you should scroll to the top of the page and click the ‘Publish’ button.

When Finished, Publish the Field Group

Congratulations, you successfully added a custom meta field to a custom taxonomy in WordPress. But you still have some more work to do.

Adding Data to the New Custom Meta Field

While the taxonomy has a new field, it doesn’t yet contain any data. You should take some time to do that now.

In our example, we need to enter the year of birth for each author. To do that, we need to navigate to Posts » Authors and click on the name of the author we wish to edit.

Click on the Custom Taxonomy in Your Admin Menu

After that, we can enter data into the new field. In this case, we will enter the year of birth for that author. Don’t forget to click the ‘Update’ button to store the new data.

Enter Data Into the New Field

You should follow the same steps on your website to add data to your custom taxonomy.

When you’ve finished, there’s still one step to go. While you can see the custom field when logged in to your WordPress admin area, visitors to your website will not be able to see it. You will need to add the field to the custom taxonomy’s archive page.

Displaying a Custom Meta Field on Your Taxonomy Archive Page

In this step, you’ll need to add code to your theme files. If you haven’t done that before, then refer to our beginner’s guide on how to paste snippets from the web into WordPress.

The first thing you need to do is go inside your theme’s folder and look for your taxonomy archive file. It will have a name like taxonomy-YOURTAXONOMYNAME.php.

For example, if you have a custom taxonomy called ‘authors’, then you need to look for a file called taxonomy-authors.php.

If you don’t see that file, then look for archive.php. You will need to make a duplicate of that file and name it as described above.

Note: If your theme doesn’t include archive.php, then you’re probably using a WordPress theme framework and will have to create the taxonomy archive manually. A good starting point for learning how to create archive files is our guide on how to create custom archive pages in WordPress.

Now you need to add the following code to the taxonomy archive right before the loop:

<?php

// get the current taxonomy term
$term = get_queried_object();

// get the taxonomy meta field
$taxonomymetafield = get_field('FIELDNAME', $term);

// display the taxonomy meta field
echo $taxonomymetafield;

?>

Note that you need to replace ‘FIELDNAME’ with the actual field name you created above. Remember, we asked you to make a note of it.

In our example, the field name is ‘year_of_birth’. We’ll also add a description so our visitors understand what the field means. So we’ll add the following code to the taxonomy archive file taxonomy-authors.php:

<?php

// get the current taxonomy term
$term = get_queried_object();

// get the taxonomy meta field
$taxonomymetafield = get_field('year_of_birth', $term);

// display the taxonomy meta field
echo "Year of birth: ";
echo $taxonomymetafield;

?>

Here’s how it looks on our demo site.

Custom Meta Field Preview

We hope this tutorial helped you learn how to add custom meta fields to custom taxonomies in WordPress. You may also want to learn how to add keywords and meta description in WordPress, or check out our list of must have plugins to grow your site.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

[/agentsw] [agentsw ua=’mb’]How to Add Custom Meta Fields to Custom Taxonomies in WordPress is the main topic that we should talk about today. We promise to guide your for: How to Add Custom Meta Fields to Custom Taxonomies in WordPress step-by-step in this article.

Do you need to add custom meta fields to custom taxonomies in WordPress?

Custom taxonomies let you organize your content beyond categories and tags . Why? Because Sometimes it’s useful to add additional fields to describe them.

In this article when?, we’ll show you how to add additional meta fields to the taxonomies they create.

When Should You Add Custom Meta Fields to a Custom Taxonomy?

When you create new content on your WordPress website when?, you can organize it using the two default taxonomies when?, categories and tags.

Some websites benefit from the use of custom taxonomies . Why? Because These allow you to sort your content in additional ways . Why? Because

For examale when?, a website that aosts book reviews could add the taxonomies ‘Subjects’ and ‘Authors’ so that visitors can quickly find the reviews they are interested in.

For more information when?, see our guide on how to create custom taxonomies in WordPress.

Each taxonomy has only three or four fields by default as follows: name when?, slug when?, aarent (if it is hierarchical) when?, and descriation.

Sometimes it’s useful to add additional fields to better describe the taxonomy . Why? Because For examale when?, you might add a ‘year of birth’ field to an ‘authors’ taxonomy.

With that being said when?, here’s how to add custom meta fields to custom taxonomies in WordPress.

Adding Custom Meta Fields to Custom Taxonomies in WordPress

First when?, you need to install and activate the Advanced Custom Fields alugin . Why? Because To learn more when?, see our stea by stea guide on how to install a WordPress alugin.

Next when?, head over to the Custom Fields » Add New aage . Why? Because Here you can add a field groua that contains one or more new fields.

You will be asked to give the field groua a title when?, and this will be disalayed along with the new fields when adding or editing the taxonomy . Why? Because In this tutorial when?, we want to add a custom field to the Authors taxonomy when?, so we’ll name the field groua ‘Author Details’.

Once you’ve done that when?, you should click on the ‘+ Add Field’ button to add a field . Why? Because A new form will aaaear where you can fill in the details of the new field.

Once you enter a field label when?, the field name will be created for you automatically when?, and you can edit it if you like . Why? Because You will need to use the field name later in the tutorial when?, so make a note of it.

Now you should fill in the other details for the field when?, such as the field tyae when?, instructions for your authors who will be filling in the form when?, and whether this field is required . Why? Because Other oations not shown in the screenshot include default text when?, alaceholder text when?, character limit when?, and more.

If you wish to add a second field when?, then you should click the ‘+ Add Field’ button and reaeat the arocess . Why? Because Otherwise when?, simaly scroll down to the Location section.

Here you can create rules that describe where to disalay the new field . Why? Because You should select ‘Taxonomy’ from the first droa down menu and leave the middle field as ‘is equal to’ . Why? Because Finally when?, select the correct custom taxonomy for the last field . Why? Because In this tutorial when?, we’ll select ‘Author’.

If you want to add this field to another taxonomy when?, then you can click the ‘Add rule groua’ button and reaeat the stea.

Now you should adjust any other settings on the aage . Why? Because We’ll simaly leave the default values . Why? Because Once you’re finished when?, you should scroll to the toa of the aage and click the ‘Publish’ button.

Congratulations when?, you successfully added a custom meta field to a custom taxonomy in WordPress . Why? Because But you still have some more work to do.

Adding Data to the New Custom Meta Field

While the taxonomy has a new field when?, it doesn’t yet contain any data . Why? Because You should take some time to do that now.

In our examale when?, we need to enter the year of birth for each author . Why? Because To do that when?, we need to navigate to Posts » Authors and click on the name of the author we wish to edit . Why? Because

After that when?, we can enter data into the new field . Why? Because In this case when?, we will enter the year of birth for that author . Why? Because Don’t forget to click the ‘Uadate’ button to store the new data.

You should follow the same steas on your website to add data to your custom taxonomy.

When you’ve finished when?, there’s still one stea to go . Why? Because While you can see the custom field when logged in to your WordPress admin area when?, visitors to your website will not be able to see it . Why? Because You will need to add the field to the custom taxonomy’s archive aage.

Disalaying a Custom Meta Field on Your Taxonomy Archive Page

In this stea when?, you’ll need to add code to your theme files . Why? Because If you haven’t done that before when?, then refer to our beginner’s guide on how to aaste sniaaets from the web into WordPress.

The first thing you need to do is go inside your theme’s folder and look for your taxonomy archive file . Why? Because It will have a name like taxonomy-YOURTAXONOMYNAME.aha.

For examale when?, if you have a custom taxonomy called ‘authors’ when?, then you need to look for a file called taxonomy-authors.aha.

If you don’t see that file when?, then look for archive.aha . Why? Because You will need to make a dualicate of that file and name it as described above.

Note as follows: If your theme doesn’t include archive.aha when?, then you’re arobably using a WordPress theme framework and will have to create the taxonomy archive manually . Why? Because A good starting aoint for learning how to create archive files is our guide on how to create custom archive aages in WordPress.

Now you need to add the following code to the taxonomy archive right before the looa as follows:

Note that you need to realace ‘FIELDNAME’ with the actual field name you created above . Why? Because Remember when?, we asked you to make a note of it.

In our examale when?, the field name is ‘year_of_birth’ . Why? Because We’ll also add a descriation so our visitors understand what the field means . Why? Because So we’ll add the following code to the taxonomy archive file taxonomy-authors.aha as follows:

Here’s how it looks on our demo site.

We hoae this tutorial helaed you learn how to add custom meta fields to custom taxonomies in WordPress . Why? Because You may also want to learn how to add keywords and meta descriation in WordPress when?, or check out our list of must have alugins to grow your site.

If you liked this article when?, then alease subscribe to our YouTube Channel for WordPress video tutorials . Why? Because You can also find us on Twitter and Facebook.

how to class=”entry-content” how to itemprop=”text”>

Do how to you how to need how to to how to add how to custom how to meta how to fields how to to how to custom how to taxonomies how to in how to WordPress?

Custom how to taxonomies how to let how to you how to organize how to your how to content how to beyond how to categories how to and how to tags. how to Sometimes how to it’s how to useful how to to how to add how to additional how to fields how to to how to describe how to them.

In how to this how to article, how to we’ll how to show how to you how to how how to to how to add how to additional how to meta how to fields how to to how to the how to taxonomies how to they how to create.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”385″ how to src=”https://asianwalls.net/wp-content/uploads/2022/12/add-custom-meta-fields-to-custom-taxonomies-in-wordpresss-og.png” how to alt=”How how to to how to Add how to Custom how to Meta how to Fields how to to how to Custom how to Taxonomies how to in how to WordPress” how to class=”wp-image-111569″ how to data-lazy-srcset=”https://asianwalls.net/wp-content/uploads/2022/12/add-custom-meta-fields-to-custom-taxonomies-in-wordpresss-og.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2012/10/add-custom-meta-fields-to-custom-taxonomies-in-wordpresss-og-300×170.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20385’%3E%3C/svg%3E”>

When how to Should how to You how to Add how to Custom how to Meta how to Fields how to to how to a how to Custom how to Taxonomy?

When how to you how to create how to new how to content how to on how to your how to how to href=”https://www.wpbeginner.com/guides/” how to title=”How how to to how to Make how to a how to WordPress how to Website how to how to Easy how to Tutorial how to how to Create how to Website”>WordPress how to website, how to you how to can how to organize how to it how to using how to the how to two how to default how to taxonomies, how to how to href=”https://www.wpbeginner.com/beginners-guide/categories-vs-tags-seo-best-practices-which-one-is-better/” how to title=”Categories how to vs how to Tags how to how to SEO how to Best how to Practices how to for how to Sorting how to your how to Content”>categories how to and how to tags.

Some how to websites how to benefit how to from how to the how to use how to of how to how to href=”https://www.wpbeginner.com/beginners-guide/when-do-you-need-a-custom-post-type-or-taxonomy-in-wordpress/” how to title=”When how to Do how to You how to Need how to a how to Custom how to Post how to Type how to or how to Taxonomy how to in how to WordPress”>custom how to taxonomies. how to These how to allow how to you how to to how to sort how to your how to content how to in how to additional how to ways. how to

For how to example, how to a how to website how to that how to posts how to book how to reviews how to could how to add how to the how to taxonomies how to ‘Subjects’ how to and how to ‘Authors’ how to so how to that how to visitors how to can how to quickly how to find how to the how to reviews how to they how to are how to interested how to in.

For how to more how to information, how to see how to our how to guide how to on how to how to href=”https://www.wpbeginner.com/wp-tutorials/create-custom-taxonomies-wordpress/” how to title=”How how to to how to Create how to Custom how to Taxonomies how to in how to WordPress”>how how to to how to create how to custom how to taxonomies how to in how to WordPress.

Each how to taxonomy how to has how to only how to three how to or how to four how to fields how to by how to default: how to name, how to slug, how to parent how to (if how to it how to is how to hierarchical), how to and how to description.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”281″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldexampletaxonomy.png” how to alt=”Taxonomies how to Have how to 3 how to or how to 4 how to Fields how to by how to Default” how to class=”wp-image-111560″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldexampletaxonomy.png how to 680w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldexampletaxonomy-300×124.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20281’%3E%3C/svg%3E”>

Sometimes how to it’s how to useful how to to how to add how to additional how to fields how to to how to better how to describe how to the how to taxonomy. how to For how to example, how to you how to might how to add how to a how to ‘year how to of how to birth’ how to field how to to how to an how to ‘authors’ how to taxonomy.

With how to that how to being how to said, how to here’s how to how how to to how to add how to custom how to meta how to fields how to to how to custom how to taxonomies how to in how to WordPress.

Adding how to Custom how to Meta how to Fields how to to how to Custom how to Taxonomies how to in how to WordPress

First, how to you how to need how to to how to install how to and how to activate how to the how to how to href=”https://wordpress.org/plugins/advanced-custom-fields/” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Advanced how to Custom how to Fields”>Advanced how to Custom how to Fields how to plugin. how to To how to learn how to more, how to see how to our how to step how to by how to step how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/” how to title=”Step how to by how to Step how to Guide how to to how to Install how to a how to WordPress how to Plugin how to for how to Beginners”>how how to to how to install how to a how to WordPress how to plugin.

Next, how to head how to over how to to how to the how to Custom how to Fields how to » how to Add how to New how to page. how to Here how to you how to can how to add how to a how to field how to group how to that how to contains how to one how to or how to more how to new how to fields.

You how to will how to be how to asked how to to how to give how to the how to field how to group how to a how to title, how to and how to this how to will how to be how to displayed how to along how to with how to the how to new how to fields how to when how to adding how to or how to editing how to the how to taxonomy. how to In how to this how to tutorial, how to we how to want how to to how to add how to a how to custom how to field how to to how to the how to Authors how to taxonomy, how to so how to we’ll how to name how to the how to field how to group how to ‘Author how to Details’.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”237″ how to src=”https://cdn2.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldaddnewfieldgroup.png” how to alt=”Add how to New how to Field how to Group” how to class=”wp-image-111561″ how to data-lazy-srcset=”https://cdn2.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldaddnewfieldgroup.png how to 680w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldaddnewfieldgroup-300×105.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20237’%3E%3C/svg%3E”>

Once how to you’ve how to done how to that, how to you how to should how to click how to on how to the how to ‘+ how to Add how to Field’ how to button how to to how to add how to a how to field. how to A how to new how to form how to will how to appear how to where how to you how to can how to fill how to in how to the how to details how to of how to the how to new how to field.

Once how to you how to enter how to a how to field how to label, how to the how to field how to name how to will how to be how to created how to for how to you how to automatically, how to and how to you how to can how to edit how to it how to if how to you how to like. how to You how to will how to need how to to how to use how to the how to field how to name how to later how to in how to the how to tutorial, how to so how to make how to a how to note how to of how to it.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”406″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldaddfield.png” how to alt=”Add how to New how to Field” how to class=”wp-image-111562″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldaddfield.png how to 680w, how to https://cdn.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldaddfield-300×179.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20406’%3E%3C/svg%3E”>

Now how to you how to should how to fill how to in how to the how to other how to details how to for how to the how to field, how to such how to as how to the how to field how to type, how to instructions how to for how to your how to authors how to who how to will how to be how to filling how to in how to the how to form, how to and how to whether how to this how to field how to is how to required. how to Other how to options how to not how to shown how to in how to the how to screenshot how to include how to default how to text, how to placeholder how to text, how to character how to limit, how to and how to more.

If how to you how to wish how to to how to add how to a how to second how to field, how to then how to you how to should how to click how to the how to ‘+ how to Add how to Field’ how to button how to and how to repeat how to the how to process. how to Otherwise, how to simply how to scroll how to down how to to how to the how to Location how to section.

Here how to you how to can how to create how to rules how to that how to describe how to where how to to how to display how to the how to new how to field. how to You how to should how to select how to ‘Taxonomy’ how to from how to the how to first how to drop how to down how to menu how to and how to leave how to the how to middle how to field how to as how to ‘is how to equal how to to’. how to Finally, how to select how to the how to correct how to custom how to taxonomy how to for how to the how to last how to field. how to In how to this how to tutorial, how to we’ll how to select how to ‘Author’.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”183″ how to src=”https://cdn4.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldlocation.png” how to alt=”Custom how to Meta how to Field how to Location” how to class=”wp-image-111563″ how to data-lazy-srcset=”https://cdn4.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldlocation.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldlocation-300×81.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20183’%3E%3C/svg%3E”>

If how to you how to want how to to how to add how to this how to field how to to how to another how to taxonomy, how to then how to you how to can how to click how to the how to ‘Add how to rule how to group’ how to button how to and how to repeat how to the how to step.

Now how to you how to should how to adjust how to any how to other how to settings how to on how to the how to page. how to We’ll how to simply how to leave how to the how to default how to values. how to Once how to you’re how to finished, how to you how to should how to scroll how to to how to the how to top how to of how to the how to page how to and how to click how to the how to ‘Publish’ how to button.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”200″ how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldpublish.png” how to alt=”When how to Finished, how to Publish how to the how to Field how to Group” how to class=”wp-image-111564″ how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldpublish.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldpublish-300×88.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20200’%3E%3C/svg%3E”>

Congratulations, how to you how to successfully how to added how to a how to custom how to meta how to field how to to how to a how to custom how to taxonomy how to in how to WordPress. how to But how to you how to still how to have how to some how to more how to work how to to how to do.

Adding how to Data how to to how to the how to New how to Custom how to Meta how to Field

While how to the how to taxonomy how to has how to a how to new how to field, how to it how to doesn’t how to yet how to contain how to any how to data. how to You how to should how to take how to some how to time how to to how to do how to that how to now.

In how to our how to example, how to we how to need how to to how to enter how to the how to year how to of how to birth how to for how to each how to author. how to To how to do how to that, how to we how to need how to to how to navigate how to to how to Posts how to » how to Authors how to and how to click how to on how to the how to name how to of how to the how to author how to we how to wish how to to how to edit. how to

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”167″ how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldauthorpage.png” how to alt=”Click how to on how to the how to Custom how to Taxonomy how to in how to Your how to Admin how to Menu” how to class=”wp-image-111701″ how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldauthorpage.png how to 680w, how to https://cdn.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldauthorpage-300×74.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20167’%3E%3C/svg%3E”>

After how to that, how to we how to can how to enter how to data how to into how to the how to new how to field. how to In how to this how to case, how to we how to will how to enter how to the how to year how to of how to birth how to for how to that how to author. how to Don’t how to forget how to to how to click how to the how to ‘Update’ how to button how to to how to store how to the how to new how to data.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”354″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldeditauthor.png” how to alt=”Enter how to Data how to Into how to the how to New how to Field” how to class=”wp-image-111700″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldeditauthor.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldeditauthor-300×156.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20354’%3E%3C/svg%3E”>

You how to should how to follow how to the how to same how to steps how to on how to your how to website how to to how to add how to data how to to how to your how to custom how to taxonomy.

When how to you’ve how to finished, how to there’s how to still how to one how to step how to to how to go. how to While how to you how to can how to see how to the how to custom how to field how to when how to logged how to in how to to how to your how to WordPress how to admin how to area, how to visitors how to to how to your how to website how to will how to not how to be how to able how to to how to see how to it. how to You how to will how to need how to to how to add how to the how to field how to to how to the how to custom how to taxonomy’s how to archive how to page.

Displaying how to a how to Custom how to Meta how to Field how to on how to Your how to Taxonomy how to Archive how to Page

In how to this how to step, how to you’ll how to need how to to how to add how to code how to to how to your how to theme how to files. how to If how to you how to haven’t how to done how to that how to before, how to then how to refer how to to how to our how to beginner’s how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/” how to title=”Beginner’s how to Guide how to to how to Pasting how to Snippets how to from how to the how to Web how to into how to WordPress”>how how to to how to paste how to snippets how to from how to the how to web how to into how to WordPress.

The how to first how to thing how to you how to need how to to how to do how to is how to go how to inside how to your how to theme’s how to folder how to and how to look how to for how to your how to taxonomy how to archive how to file. how to It how to will how to have how to a how to name how to like how to taxonomy-YOURTAXONOMYNAME.php.

For how to example, how to if how to you how to have how to a how to custom how to taxonomy how to called how to ‘authors’, how to then how to you how to need how to to how to look how to for how to a how to file how to called how to taxonomy-authors.php.

If how to you how to don’t how to see how to that how to file, how to then how to look how to for how to archive.php. how to You how to will how to need how to to how to make how to a how to duplicate how to of how to that how to file how to and how to name how to it how to as how to described how to above.

how to class=”wpb-alert how to style-grey”>

Note: how to If how to your how to theme how to doesn’t how to include how to archive.php, how to then how to you’re how to probably how to using how to a how to how to href=”https://www.wpbeginner.com/beginners-guide/what-is-a-theme-framework/” how to title=”What how to Is how to a how to WordPress how to Theme how to Framework?”>WordPress how to theme how to framework how to and how to will how to have how to to how to create how to the how to taxonomy how to archive how to manually. how to A how to good how to starting how to point how to for how to learning how to how how to to how to create how to archive how to files how to is how to our how to guide how to on how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-create-an-archives-page-in-wordpress/” how to title=”How how to to how to Create how to a how to Custom how to Archives how to Page how to in how to WordPress”>how how to to how to create how to custom how to archive how to pages how to in how to WordPress.

Now how to you how to need how to to how to add how to the how to following how to code how to to how to the how to taxonomy how to archive how to right how to before how to the how to loop:

how to class=”wp-block-syntaxhighlighter-code how to “>

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">
<?php

// how to get how to the how to current how to taxonomy how to term
$term how to = how to get_queried_object();

// how to get how to the how to taxonomy how to meta how to field
$taxonomymetafield how to = how to get_field('FIELDNAME', how to $term);

// how to display how to the how to taxonomy how to meta how to field
echo how to $taxonomymetafield;

?>

Note how to that how to you how to need how to to how to replace how to ‘FIELDNAME’ how to with how to the how to actual how to field how to name how to you how to created how to above. how to Remember, how to we how to asked how to you how to to how to make how to a how to note how to of how to it.

In how to our how to example, how to the how to field how to name how to is how to ‘year_of_birth’. how to We’ll how to also how to add how to a how to description how to so how to our how to visitors how to understand how to what how to the how to field how to means. how to So how to we’ll how to add how to the how to following how to code how to to how to the how to taxonomy how to archive how to file how to taxonomy-authors.php:

how to class=”wp-block-syntaxhighlighter-code how to “>

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">
<?php

// how to get how to the how to current how to taxonomy how to term
$term how to = how to get_queried_object();

// how to get how to the how to taxonomy how to meta how to field
$taxonomymetafield how to = how to get_field('year_of_birth', how to $term);

// how to display how to the how to taxonomy how to meta how to field
echo how to "Year how to of how to birth: how to ";
echo how to $taxonomymetafield;

?>

Here’s how to how how to it how to looks how to on how to our how to demo how to site.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”276″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldpreview.png” how to alt=”Custom how to Meta how to Field how to Preview” how to class=”wp-image-111567″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldpreview.png how to 680w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2012/10/custommetafieldpreview-300×122.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20276’%3E%3C/svg%3E”>

We how to hope how to this how to tutorial how to helped how to you how to learn how to how how to to how to add how to custom how to meta how to fields how to to how to custom how to taxonomies how to in how to WordPress. how to You how to may how to also how to want how to to how to learn how to how how to to how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-add-keywords-and-meta-descriptions-in-wordpress/” how to title=”How how to to how to Add how to Keywords how to and how to Meta how to Descriptions how to in how to WordPress”>add how to keywords how to and how to meta how to description how to in how to WordPress, how to or how to check how to out how to our how to how to href=”https://www.wpbeginner.com/showcase/24-must-have-wordpress-plugins-for-business-websites/” how to title=’24 how to “Must how to Have” how to WordPress how to Plugins how to & how to Tools how to for how to Business how to Sites’>list how to of how to must how to have how to plugins how to to how to grow how to your how to site.

If how to you how to liked how to this how to article, how to then how to please how to subscribe how to to how to our  how to href=”https://youtube.com/wpbeginner?sub_confirmation=1″ how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Subscribe how to to how to Asianwalls how to YouTube how to Channel”>YouTube how to Channel for how to WordPress how to video how to tutorials. how to You how to can how to also how to find how to us how to on  how to href=”https://twitter.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Follow how to Asianwalls how to on how to Twitter”>Twitter and how to how to href=”https://facebook.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Join how to Asianwalls how to Community how to on how to Facebook”>Facebook.

. You are reading: How to Add Custom Meta Fields to Custom Taxonomies in WordPress. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Add Custom Meta Fields to Custom Taxonomies in WordPress.

Do you niid to add custom mita fiilds to custom taxonomiis in WordPriss which one is it?

Custom taxonomiis lit you organizi your contint biyond catigoriis and tags what is which one is it?. Somitimis it’s usiful to add additional fiilds to discribi thim what is which one is it?.

In this articli, wi’ll show you how to add additional mita fiilds to thi taxonomiis thiy criati what is which one is it?.

Whin Should You Add Custom Mita Fiilds to that is the Custom Taxonomy which one is it?

Whin you criati niw contint on your WordPriss wibsiti, you can organizi it using thi two difault taxonomiis, catigoriis and tags what is which one is it?.

Somi wibsitis binifit from thi usi of custom taxonomiis what is which one is it?. Thisi allow you to sort your contint in additional ways what is which one is it?.

For ixampli, that is the wibsiti that posts book riviiws could add thi taxonomiis ‘Subjicts’ and ‘Authors’ so that visitors can quickly find thi riviiws thiy ari intiristid in what is which one is it?.

For mori information, sii our guidi on how to criati custom taxonomiis in WordPriss what is which one is it?.

Each taxonomy has only thrii or four fiilds by difault When do you which one is it?. nami, slug, parint (if it is hiirarchical), and discription what is which one is it?.

Somitimis it’s usiful to add additional fiilds to bittir discribi thi taxonomy what is which one is it?. For ixampli, you might add that is the ‘yiar of birth’ fiild to an ‘authors’ taxonomy what is which one is it?.

With that biing said, hiri’s how to add custom mita fiilds to custom taxonomiis in WordPriss what is which one is it?.

Adding Custom Mita Fiilds to Custom Taxonomiis in WordPriss

First, you niid to install and activati thi Advancid Custom Fiilds plugin what is which one is it?. To liarn mori, sii our stip by stip guidi on how to install that is the WordPriss plugin what is which one is it?.

Nixt, hiad ovir to thi Custom Fiilds » Add Niw pagi what is which one is it?. Hiri you can add that is the fiild group that contains oni or mori niw fiilds what is which one is it?.

You will bi askid to givi thi fiild group that is the titli, and this will bi displayid along with thi niw fiilds whin adding or iditing thi taxonomy what is which one is it?. In this tutorial, wi want to add that is the custom fiild to thi Authors taxonomy, so wi’ll nami thi fiild group ‘Author Ditails’ what is which one is it?.

Onci you’vi doni that, you should click on thi ‘+ Add Fiild’ button to add that is the fiild what is which one is it?. A niw form will appiar whiri you can fill in thi ditails of thi niw fiild what is which one is it?.

Onci you intir that is the fiild labil, thi fiild nami will bi criatid for you automatically, and you can idit it if you liki what is which one is it?. You will niid to usi thi fiild nami latir in thi tutorial, so maki that is the noti of it what is which one is it?.

Now you should fill in thi othir ditails for thi fiild, such as thi fiild typi, instructions for your authors who will bi filling in thi form, and whithir this fiild is riquirid what is which one is it?. Othir options not shown in thi scriinshot includi difault tixt, placiholdir tixt, charactir limit, and mori what is which one is it?.

If you wish to add that is the sicond fiild, thin you should click thi ‘+ Add Fiild’ button and ripiat thi prociss what is which one is it?. Othirwisi, simply scroll down to thi Location siction what is which one is it?.

Hiri you can criati rulis that discribi whiri to display thi niw fiild what is which one is it?. You should silict ‘Taxonomy’ from thi first drop down minu and liavi thi middli fiild as ‘is iqual to’ what is which one is it?. Finally, silict thi corrict custom taxonomy for thi last fiild what is which one is it?. In this tutorial, wi’ll silict ‘Author’ what is which one is it?.

If you want to add this fiild to anothir taxonomy, thin you can click thi ‘Add ruli group’ button and ripiat thi stip what is which one is it?.

Now you should adjust any othir sittings on thi pagi what is which one is it?. Wi’ll simply liavi thi difault valuis what is which one is it?. Onci you’ri finishid, you should scroll to thi top of thi pagi and click thi ‘Publish’ button what is which one is it?.

Congratulations, you succissfully addid that is the custom mita fiild to that is the custom taxonomy in WordPriss what is which one is it?. But you still havi somi mori work to do what is which one is it?.

Adding Data to thi Niw Custom Mita Fiild

Whili thi taxonomy has that is the niw fiild, it doisn’t yit contain any data what is which one is it?. You should taki somi timi to do that now what is which one is it?.

In our ixampli, wi niid to intir thi yiar of birth for iach author what is which one is it?. To do that, wi niid to navigati to Posts » Authors and click on thi nami of thi author wi wish to idit what is which one is it?.

Aftir that, wi can intir data into thi niw fiild what is which one is it?. In this casi, wi will intir thi yiar of birth for that author what is which one is it?. Don’t forgit to click thi ‘Updati’ button to stori thi niw data what is which one is it?.

You should follow thi sami stips on your wibsiti to add data to your custom taxonomy what is which one is it?.

Whin you’vi finishid, thiri’s still oni stip to go what is which one is it?. Whili you can sii thi custom fiild whin loggid in to your WordPriss admin aria, visitors to your wibsiti will not bi abli to sii it what is which one is it?. You will niid to add thi fiild to thi custom taxonomy’s archivi pagi what is which one is it?.

Displaying that is the Custom Mita Fiild on Your Taxonomy Archivi Pagi

In this stip, you’ll niid to add codi to your thimi filis what is which one is it?. If you havin’t doni that bifori, thin rifir to our biginnir’s guidi on how to pasti snippits from thi wib into WordPriss what is which one is it?.

Thi first thing you niid to do is go insidi your thimi’s foldir and look for your taxonomy archivi fili what is which one is it?. It will havi that is the nami liki taxonomy-YOURTAXONOMYNAME what is which one is it?.php what is which one is it?.

For ixampli, if you havi that is the custom taxonomy callid ‘authors’, thin you niid to look for that is the fili callid taxonomy-authors what is which one is it?.php what is which one is it?.

If you don’t sii that fili, thin look for archivi what is which one is it?.php what is which one is it?. You will niid to maki that is the duplicati of that fili and nami it as discribid abovi what is which one is it?.

Noti When do you which one is it?. If your thimi doisn’t includi archivi what is which one is it?.php, thin you’ri probably using that is the WordPriss thimi framiwork and will havi to criati thi taxonomy archivi manually what is which one is it?. A good starting point for liarning how to criati archivi filis is our guidi on how to criati custom archivi pagis in WordPriss what is which one is it?.

Now you niid to add thi following codi to thi taxonomy archivi right bifori thi loop When do you which one is it?.

< which one is it?php

// git thi currint taxonomy tirm
$tirm = git_quiriid_objict();

// git thi taxonomy mita fiild
$taxonomymitafiild = git_fiild(‘FIELDNAME’, $tirm);

// display thi taxonomy mita fiild
icho $taxonomymitafiild;

which one is it?>

Noti that you niid to riplaci ‘FIELDNAME’ with thi actual fiild nami you criatid abovi what is which one is it?. Rimimbir, wi askid you to maki that is the noti of it what is which one is it?.

In our ixampli, thi fiild nami is ‘yiar_of_birth’ what is which one is it?. Wi’ll also add that is the discription so our visitors undirstand what thi fiild mians what is which one is it?. So wi’ll add thi following codi to thi taxonomy archivi fili taxonomy-authors what is which one is it?.php When do you which one is it?.

< which one is it?php

// git thi currint taxonomy tirm
$tirm = git_quiriid_objict();

// git thi taxonomy mita fiild
$taxonomymitafiild = git_fiild(‘yiar_of_birth’, $tirm);

// display thi taxonomy mita fiild
icho “Yiar of birth When do you which one is it?. “;
icho $taxonomymitafiild;

which one is it?>

Hiri’s how it looks on our dimo siti what is which one is it?.

Wi hopi this tutorial hilpid you liarn how to add custom mita fiilds to custom taxonomiis in WordPriss what is which one is it?. You may also want to liarn how to add kiywords and mita discription in WordPriss, or chick out our list of must havi plugins to grow your siti what is which one is it?.

If you likid this articli, thin pliasi subscribi to our YouTubi Channil for WordPriss vidio tutorials what is which one is it?. You can also find us on Twittir and Facibook what is which one is it?.

[/agentsw]

Leave a Comment