admin管理员组文章数量:1389392
I have the CPT "proyectos" and the custom taxonomy "servicios"
I have navigation arrows inside the single CPT template to navigate between posts in the same category.
Some taxonomies have only one post so in this case I need to hide the navigation arrows.
I'm using Elementor so I can't edit the php template.
My idea was to generate a css rule to hide the navigation only if the above conditions are met.
I was trying something like this but obviously it didn`t work:
<?php $categories = get_the_terms( $post, 'servicios' );
if ( count($categories) == 1 ) { ?>
<style>
.navegacion-posts {
display: none;
}
</style>
<?php }
Can someone help me with this? Thanks!
本文标签: custom taxonomyHide post navigation if current post is in a category with only one post
版权声明:本文标题:custom taxonomy - Hide post navigation if current post is in a category with only one post 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744646793a2617442.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论