根据类别Tribe事件显示不同的信息

问题描述 投票:0回答:1

可能是在事件结束时,它会根据使用Tribe事件插件的事件类别显示不同的信息?

我正在尝试使用此代码,但我没有成功

<?php do_action('tribe_get_event_cat_slugs');
                if ( $slugs = ((array) 'charity') ) : ?>
                <p>If is 'charity' slug</p>
                <?php else : ?>
                <p>If is 'charity' slug</p>
        [contact-form-7 id="770" title="Inscrieri"]
<?php endif?>
php events categories slug
1个回答
0
投票

你的代码

<?php if ( $slugs = ((array) 'charity') ) {} ?>

((array) 'charity') )分配给$slugs。请务必阅读comparison operators上的文档。

© www.soinside.com 2019 - 2024. All rights reserved.