Post Meta: Displaying custom taxonomy in single-post template
-
I created a custom taxonomy and would like the option to display it in the post-meta section of the single-post template.
1) The Customizer allows users to select post meta options for two sections – “Top Post Meta” and “Bottom Post Meta.” Is it possible to add my custom taxonomy to these lists in the Customizer?
2) In functions.php, there’s a comment that suggests you can show additional meta items (without using the Customizer) by hooking into ‘chaplin_start_of_post_meta_list’ and ‘chaplin_end_of_post_meta_list’.
The following code works as expected in the ‘single-top’ meta location, but the ‘single-bottom’ location doesn’t display a result when using ‘chaplin_end_of_post_meta_list’:
add_action('chaplin_end_of_post_meta_list', 'add_custom_taxonomy'); function add_custom_taxonomy() { echo '<li>Custom taxonomy list: code goes here</li>'; }
Note: That code works for ‘single-bottom’ location if you hook into ‘chaplin_start_of_post_meta_list’. Only the single-bottom and chaplin_end_of_post_meta_list combination seems broken.
Question 1: Is this a bug? Or am I doing it wrong?
Question 2: How would I print the list of custom taxonomies applied to the post using this hook?Thanks so much if you’re able to answer these questions. I’ve been so impressed with the Chaplin theme so far. It’s spectacular.
- The topic ‘Post Meta: Displaying custom taxonomy in single-post template’ is closed to new replies.