我正在使用一个名为“price_tag”的自定义类型标签来显示它们的列表,我使用这个:
<?php if(get_the_term_list($post->ID, 'price_tag')) echo get_the_term_list($post->ID, 'price_tag', '', ' - ', '' ); else echo __('No Tags', 'custom-lang'); ?>
我想要的是使用“price_tag”创建一个条件来显示文本,如果帖子有某个“price_tag”
所以我想试试这个
<? if ( has_tag ('certaintag' ) ) { ?>
Show something
<? } else {} ?>
“cetainbtag”只是一个标签,我想用来在所有具有该标签的帖子中显示文本。
但我无法让它工作,因为我不是 wordpress 技术人员,我不知道如何在这个条件中包含“price_tag”。
请帮忙。我很感激。