Php Wordpress:在groups循环中生成join group按钮
这就是我所拥有的:Php Wordpress:在groups循环中生成join group按钮,php,wordpress,Php,Wordpress,这就是我所拥有的: <ul id="popular"> <?php while ( bp_groups() ) : bp_the_group(); ?> <li <?php bp_group_class(); ?>> <div class="group-box"> <div class="group-box-image-container"> <a class="gro
<ul id="popular">
<?php while ( bp_groups() ) : bp_the_group(); ?>
<li <?php bp_group_class(); ?>>
<div class="group-box">
<div class="group-box-image-container">
<a class="group-box-image" href="<?php bp_group_permalink() ?>"><?php bp_group_avatar( 'type=full' ) ?></a>
</div>
<div class="group-box-right">
<div class="group-box-title"><a href="<?php bp_group_permalink() ?>"><?php $grouptitle = bp_get_group_name(); $getlength = strlen($grouptitle); $thelength = 20; echo mb_substr($grouptitle, 0, $thelength, 'UTF-8'); if ($getlength > $thelength) echo "..."; ?></a></div>
<div class="group-box-details">
<div class="gb-a">Active <?php echo bp_get_group_last_active(); ?></div>
<div class="gb-m"><?php bp_group_member_count(); ?></div>
</div>
</div>
</div><!--group-box ends-->
</li>
<?php endwhile; ?>
</ul>
我需要的是:一个允许每个登录成员加入该组的链接
我该怎么做?我还激活了邀请任何人插件…好的,我知道了:
在遗留主题的文件groups-header.php中,我找到了以下代码:
do_action( 'bp_group_header_actions' );
上面的代码发挥了神奇的作用。有趣的是wordpress是如何描述这些行为的。。。不太明显,是吗
不管怎样,现在它工作了。对于那些需要它的人,现在你知道了: