• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Genesis Custom Blocks

Genesis Custom Blocks

Create effective content faster.

  • Need Help?
You are here: Home / Fields / Taxonomy

Taxonomy

This field type requires the Genesis Custom Blocks Pro plugin which is available through a Genesis Pro subscription.

The Taxonomy field allows you to select one of your WordPress® taxonomies from a searchable dropdown menu.1

Screenshot of Taxonomy field settings

Click image to enlarge

  1. Field Label: The field label will be displayed next to the field when adding it the block to the post or page.
  2. Field Name: The field name should auto-fill based on the field label, but can be customized. This will be used in the PHP as part of the block template.
  3. Field Type: Choose the Taxonomy field type.
  4. Field Location: Choose a location to display the field.
    • Editor will show the field in the main editing area of a post or page.
    • Inspector will display the field in the right-hand sidebar under the block inspector.
  5. Field Width: Select how widely the field should be displayed.
  6. Help Text: Instructions to describe the data needed in the field.
  7. Taxonomy Type: The taxonomy type filter (e.g. Categories, Tags)

PHP API Controls

  • name
  • label
  • control
  • type
  • order
  • location
  • width
  • help
  • post_type_rest_slug

Template Usage

To display the Taxonomy field in your template, use the field name you provided.

There are two ways you can do this.

  1. Template Editor: Using the built-in template editor is the easiest way to create the required block template. The template editor accepts HTML markup, field names (enclosed in 2 brackets), and CSS only.

Here’s an example of HTML you can use in the template editor:

<h2>{{source}}</h2>

Note: In the Template Editor, the Taxonomy field will render the term name. When rendering anything else, like the term link, please use PHP templating method described below.

  1. PHP Template: If you need to use logic, loop syntax, define variables, or use PHP, you can create the template manually using the PHP templating method instead.
<?php block_field( 'source' ); ?>

The API will return a WP_Taxonomy object, and echo the Taxonomy’s name. See the WP_Taxonomy class for details.

Example template file /blocks/block-example.php

<?php
// Example Taxonomy Field

$taxonomy = block_value( 'source' ); // can be named anything, e.g., $source
$terms = get_terms( $taxonomy );

foreach ($terms as $term ) {
    $term_link = get_term_link( $term );

    if ( is_wp_error( $term_link ) ) { // just in case we encounter an error
        continue;
    }

    echo 'View more: <a href="' . esc_url( $term_link ) . '">' . $term->name . '</a>';
}

Block Usage

To use the block with the Taxonomy field on your site, locate it in the blocks menu.

Screenshot of custom block in the blocks menu

Click image to enlarge

It will then display within your post or page editor.

Screenshot of Taxonomy field settings

Click image to enlarge

And then on the front end of your site.

Screenshot of Taxonomy field on frontend of the site

Primary Sidebar

Get Started

  • Install Genesis Custom Blocks (free)
  • Install Genesis Custom Blocks Pro
  • Update Genesis Custom Blocks Pro
  • General Settings and Options

Create Custom Blocks

  • Create Your First Custom Block
  • Example Custom Block
  • Add a Custom Block to Your Website Content
  • Style Your Custom Blocks

Export and Import Custom Blocks

  • Export Custom Blocks to Include in Your Theme

Code References

  • Fields
  • Functions
  • Filters

Tutorials & FAQs

  • Tutorials
  • FAQs

Resources

  • Changelog
  • Block Lab Hook Compatibility
  • Block Lab PHP API Compatibility
  • Support

© 2013–2025 WPEngine, Inc. All rights reserved. WP ENGINE®, VELOCITIZE®, TORQUE®, EVERCACHE®, and the cog logo service marks are owned by WPEngine,Inc.
1WP Engine is a proud member and supporter of the community of WordPress® users. The WordPress® trademarks are the intellectual property of the WordPress Foundation, and the Woo® and WooCommerce® trademarks are the intellectual property of WooCommerce, Inc. Uses of the WordPress®, Woo®, and WooCommerce® names in this website are for identification purposes only and do not imply an endorsement by WordPress Foundation or WooCommerce, Inc. WP Engine is not endorsed or owned by, or affiliated with, the WordPress Foundation or WooCommerce, Inc.