Hello –
I am trying to figure out why my custom taxonomies don’t appear on the single post of my CPT “Resources”. I am using the vantage theme, and the tags I copied form my “Posts” appear on the CPT only.
http://dev.californiaseec.org/resource/sample-1/
Any help on why this is?
thanks in advance!!
Hi ICLEIUSA
Thanks for reaching out. Are you expecting your custom taxonomy to be listed in the bottom post meta “Posted in and tagged in”? If so, I wouldn’t imagine they would show there. The category list uses:
https://codex.wordpress.org/Function_Reference/get_the_category_list
Ah I see, thank you..
Do you know if there is a way to get custom Taxonomies recognized as a post_id? Or just listed in the “Posted in…” section
There is, unfortunately, no easy way without heading down the custom development route. Perhaps consider using a sidebar widget:
https://wordpress.org/plugins/search.php?type=term&q=custom+taxonomies+widget
You could add Jetpack Widget Visibility to choose when to display the widget:
http://jetpack.me/support/widget-visibility/
Thank you, we are trying to limit our use of plugins.. but are somewhat familiar with php and not averse to custom development. If you have any resources you are aware of the help me go down that route I would appreciate it!
In the meantime I will keep looking myself.
thanks
In that case you should be able to sort this out. You’ll need to work from within a child theme. Here is a starter child theme for Vantage:
https://siteorigin.com/wp-content/uploads/2015/03/vantage-child-starter.zip
Download the ZIP and install from Appearance > Themes > Add New: Upload.
Menu location assignments will reset as a result, just re-save.
We need to work in a child theme as all WordPress.org themes overwrite during theme updates.
If you check content-single.php in the parent theme you’ll find the following action hook:
If you then go to /inc/template-tags.php in the parent theme and check from line 328 on you’ll find the vantage_get_post_categories function. Unfortunately, this function isn’t wrapped in a if function exists conditional so we can’t just go drop that function in the functions.php of our child theme. If this function was wrapped would just insert it into functions.php in the child theme and edit away.
Here is a simple overview to what we’d need to adapt this function from our child theme:
http://themeshaper.com/2009/05/03/filters-wordpress-child-themes/
So…depending on the skills available on your side, I might be able to leave you here. Hopefully the above and this link will get you started:
https://codex.wordpress.org/Function_Reference/get_taxonomies
Correction: Sorry, the vantage_entry_main_bottom action hook isn’t being used. The function I discussed is just being outputted in content-single.php using the following:
So another way to do this would be to put content-single.php in your child theme and then remove:
Replacing it with your own function.