Php WP-根据职位类别隐藏特定部门
大家好,我有一个关于后期定制的小问题。 我想根据帖子类别在帖子模板中隐藏一个特定的div 如果职位类别设置为annuaire,我想隐藏coordonnees id第139行的div 如果你知道怎么做,那就太棒了 非常感谢你的帮助 标题=/> &hellip 给你Php WP-根据职位类别隐藏特定部门,php,wordpress,Php,Wordpress,大家好,我有一个关于后期定制的小问题。 我想根据帖子类别在帖子模板中隐藏一个特定的div 如果职位类别设置为annuaire,我想隐藏coordonnees id第139行的div 如果你知道怎么做,那就太棒了 非常感谢你的帮助 标题=/> &hellip 给你 <?php $categories = get_the_category();?> <div id="coordonnees" <?php echo esc_html( $categories[0]->
<?php $categories = get_the_category();?>
<div id="coordonnees" <?php echo esc_html( $categories[0]->name ) == 'annuaire' ? 'style="display:none"' : ''?> >
你好,尼沙德,非常感谢你的帮助。我已尝试插入您的代码,但没有任何更改…:'你知道为什么它不起作用吗?