In your loop use has_term( $term, $taxonomy, $post )
.
- Check if the post has the term you are searching for.
- Check if there is a value for the custom field.
- Print the value, but don’t forget to escape it.
if ( has_term( 'blue', 'product_color', $post ) )
{
$field = get_post_meta( $post->ID, 'field_name', TRUE );
if ( ! empty ( $field ) )
echo esc_html( $field );
}
Related Posts:
- Is it possible to sort the post based on a custom field?
- How to separate posts in loop?
- Convert post meta to custom taxonomy?
- Count tags for current post and save into custom meta field (and update it on post edit)
- Is it possible to sort the post based on a custom field?
- Advanced search form with filters for custom taxonomies and custom fields
- Is ACF being a honey trap? [closed]
- Add custom taxonomy fields when creating a new taxonomy
- WordPress database error: [Not unique table/alias: ‘wp_postmeta’]
- How to modify the query in taxonomy-custom.php to sort term archives by a custom meta field?
- Get value in custom field with taxonomy [closed]
- How much faster is a tax query than a meta query?
- Remove Category description textarea
- Use custom posts as taxonomy term meta replacement?
- Custom metabox for menu administration page?
- Custom Fields and performance
- register_rest_field for custom taxonomy fields that are assosiated with custom post type
- Custom taxonomy – custom sortable column
- How to display submenus on page based on referring top-level parent?
- List Custom Taxonomy Values according to a Post Meta Value
- How get custom field from custom taxonomy?
- Automatically assign taxonomy term if custom meta value exists
- How to add custom field to custom taxonomy in 4.4
- how to search in custom fields & custom taxonomy for custom search
- Getting yoast title for custom taxonomy
- Outputting an array of term meta values in a custom WooCommerce tab?
- Storing data into custom taxonomies VS post custom fields (post meta)
- get_the_terms() to show all custom taxonomies
- List the number of posts for each custom taxonomy and specific custom field value
- Single reusable value for post meta: Custom Taxonomy or Post Meta?
- Solve product properties with custom taxonomies?
- Is it acceptable to build functionality into a theme built for a client? [closed]
- $wpdb query a post type within a specific taxonomy term while ordering posts by custom meta value?
- Custom fields to taxonomy
- Custom fields ‘for’ custom taxonomy?? Can someone explain why?
- Print terms with taxonomy and metabox value
- Styling Taxonomy Terms Individually
- Can I use a Custom Meta Value inside of ‘get_the_terms’?
- How to add contents of a custom field to a taxonomy term list?
- How can I hide admin columns showing extra custom taxonomy fields?
- Conditional display for custom fields/taxonomy
- How do I modify the “Insert Media” lightbox in the admin to only show media items from a category?
- What is faster: custom taxonomy or serialized post-meta for db retrieval? (over 60,000 posts)
- I am trying to display information from a custom table from my wordpress users pages
- Is it possible to store Json data in post_meta and manipulate
- Save custom taxonomy data in different table not in wp_options for my own plugin
- Add Custom Taxonomy for Blog Meta Info
- How to create a dependent drop-down and options in dropdown must be manageable from admin panel
- Search Tool only refreshes Page without showing results
- Display value of custom field of custom taxonomy in single post?
- Creating terms vs custom post meta to save data?
- Removing “s” from search with custom parameters
- How to fetch the data from Advanced Custom post when we search specific keyword or field name related to the post?
- How do I display a custom field from a custom taxonomy in single.php?
- Multi-select field for Taxonomy can’t save the value
- Does using custom taxonomy is more CPU efficient than using meta_data?
- WordPress implode & wp_insert_post question
- how to store values in database at hierarchical view
- Best structure for entering recipes in a WordPress theme?
- WP REST API – get custom taxonomies based on terms & filter
- wp_query not resetting, last post hanging
- Copy/clone/associate Custom field to Custom Taxonomy
- saving meta/custom field to tag
- How to support fifteen thousand terms in WordPress?
- Different Taxonomy Values for Each Post
- Filter through custom taxonomy with an array of taxonomy IDs
- What’s the best way to add taxonomy’s image in 2017?
- Loop through custom taxanomy in post and display custom fields from posts
- Count of posts by different parameters?
- Why can’t I access Custom Taxonomy metadata?
- WooCommerce custom taxonomy as meta?
- SQL / wp_update_post: change post custom field to CPT post taxonomy
- Filter by Custom Taxonomy AND Custom Field
- Can You Build Page Templates Without Extra Files
- Extra Meta Data for WordPress Multisite Taxonomy
- Taxonomy or Custom Field
- Sort taxonomy page alphabetically by meta rather than default post date
- Is there a way to nest taxonomies or custom fields deeper than one level below the post type?
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- How to use custom slug and custom templates for custom taxonomy?
- Create multiple taxonomies with custom fields values on the fly when creating new posts
- Custom field with terms from another taxonomy programmatically
- Create new Taxonomy, add extra fields, register terms AND extra fields values?
- Dropdown (with onChange) with custom taxonomies
- ACF – Get unique values of array
- Remove Custom metabox from particular page template is used
- ACF Custom field not showing in Timber Taxonomy page
- Pre_get_post custom taxonomy combined with custom fields?
- Adding a checkbox field to a (custom) taxonomy
- Add and Custom category for posts “PAGE”
- Reset custom taxonomy meta data after saving
- how to filter the data’s comparison operators (>= &
- How to add meta fields to custom taxonomy add/edit page?
- How to filter a taxonomy meta field to the ‘single_term_title’ filter hook
- Custom post type term names with ampersand in the term name
- sort Posts by custom user filed
- Looking for suggestions on creating simple database (Help!!)
- get meta fields and taxonomy of any post type
- Where to put a migration script to switch post information?
- Register custom taxonomy from a Advenced custom field option page