Last active
April 15, 2020 03:33
-
-
Save wplit/a714eacb72cb935ae1c627f961b6e798 to your computer and use it in GitHub Desktop.
show taxonomy field inside single post template (must have only one term)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| global $post; | |
| $taxonomy = 'study_series'; | |
| $taxonomy_field = 'series_subtitle'; | |
| $terms = wp_get_post_terms($post->ID, $taxonomy, array('fields' => 'ids')); | |
| if ($terms) { | |
| ?><p>Subtitle: <?php the_field($taxonomy_field, $taxonomy.'_'.$terms[0]); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment