admin管理员组文章数量:1287524
For a site I need to show related posts for a custom taxonomy. Because another person build this site and also created a custom taxonomy, and this code can't be found in a proper file like functions.php or a plugin, I need to track this name so I can use it for other code solutions.
For clarity; If I create a custom taxonomy, a part of the code is
register_taxonomy('**SUBJECT TO TRACK**',array('customposttype'), array(
I need to track the part of 'SUBJECT TO TRACK'. Is there any function I could use to show this on a page? probably the answer is simple, but i can't find it anywhere...
For a site I need to show related posts for a custom taxonomy. Because another person build this site and also created a custom taxonomy, and this code can't be found in a proper file like functions.php or a plugin, I need to track this name so I can use it for other code solutions.
For clarity; If I create a custom taxonomy, a part of the code is
register_taxonomy('**SUBJECT TO TRACK**',array('customposttype'), array(
I need to track the part of 'SUBJECT TO TRACK'. Is there any function I could use to show this on a page? probably the answer is simple, but i can't find it anywhere...
Share Improve this question asked Sep 21, 2021 at 15:09 RicardioRicardio 381 silver badge8 bronze badges1 Answer
Reset to default 0After messing with some code I found a solution: just use this code and a lot if information will be showed. Within all this data you search for the categorie that is inside your taxonomy and you'll see the taxonomy-> name.
// Show all data of all taxonomies
function print_tax_data(){
$data = get_terms();
print_r($data);
}
add_shortcode('tax_data', 'print_tax_data');
本文标签: Tracking the name of a custom taxonomy
版权声明:本文标题:Tracking the name of a custom taxonomy 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741308512a2371513.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论