admin管理员组文章数量:1384114
need some help with cpt having next-previous links with title or related posts. I'm using Oceanwp theme. For normal posts it show related posts. But for CPT, some code has to be edited.
In the child theme I've copied some files and I can see related posts in cpt but with default categories not with custom taxonomy associated with CPT. This is the code in theme i need help with:
// Term
$term_tax = get_theme_mod( 'ocean_single_post_next_prev_taxonomy', 'post_tag' );
$term_tax = $term_tax ? $term_tax : 'post_tag';
It is in my child theme next-prev-subjects.php and related-posts-subjects.php.
How can I edit this code to use custom taxonomies. I've CPT named Subjects and 3 category like custom taxonomies: Physics, Chem, Maths and one tags like custom taxonomy named tagsubject.
I tried this one but didn't worked
// Term
$term_tax = get_theme_mod( 'ocean_single_post_next_prev_taxonomy', 'subject_category' );
$term_tax = $term_tax ? $term_tax : 'subject_category';
Do I've to use this:
$terms_tax = get_terms( array(
'taxonomy' => 'physics','chem','maths'
'hide_empty' => false,
) );
Any help with this way or any other way will be really appreciated. For other ways I did found similar questions in this forum but I don't know which files to edit or create in the child theme.
本文标签: Calling custom taxonomies
版权声明:本文标题:Calling custom taxonomies 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744487488a2608537.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论