如何将订阅者从WordPress列表中排除

时间:2020-03-24 作者:Tuagapat Manam

有些什么我有这个代码工作得很好,问题不是从列表中排除订阅者,有人可以帮我从列表中排除订阅者。。thx公司

<?php 
$number   = 10;
$paged    = (get_query_var(\'paged\')) ? get_query_var(\'paged\') : 1;
$offset   = ($paged - 1) * $number;
$users    = get_users();
$query    = get_users(\'&offset=\'.$offset.\'&number=\'.$number);
$total_users = count($users);
$total_query = count($query);
$total_pages = intval($total_users / $number) + 1;
echo \'<ul id="list-mitra">\';
foreach($query as $q) { ?>
  <li class="bullet-arrow">
        <a href="#mitra<?php echo get_the_author_meta( \'ID\', $q->ID);?>">
          <?php echo get_the_author_meta(\'display_name\', $q->ID);?>
        </a>
  </li>

<?php echo do_shortcode(\'[lightbox id="mitra\' . get_the_author_meta( \'ID\', $q->ID) . \'" width="600px" padding="20px"]
<p>Nama: \'.get_the_author_meta(\'display_name\', $q->ID).\'</p>
<p>Nama Panggilan</p>
<p>Alamat</p>
<p>No Handphone</p>
<p>Upline</p>
<p>Tim</p>
<p>Leader Tim</p>
[/lightbox]\'); ?>

<?php } 
echo \'</ul>\'; ?>

1 个回复
SO网友:Tuagapat Manam

工作代码。。thx@迈克尔

<?php 
$number   = 10;
$paged    = (get_query_var(\'paged\')) ? get_query_var(\'paged\') : 1;
$offset   = ($paged - 1) * $number;
$users    = get_users();
$query    = get_users(\'&offset=\'.$offset.\'&number=\'.$number.\'&role__not_in=\'.subscriber);
$total_users = count($users);
$total_query = count($query);
$total_pages = intval($total_users / $number) + 1;
echo \'<ul id="list-mitra">\';
foreach($query as $q) { ?>
  <li class="bullet-arrow">
        <a href="#mitra<?php echo get_the_author_meta( \'ID\', $q->ID);?>">
          <?php echo get_the_author_meta(\'display_name\', $q->ID);?>
        </a>
  </li>

<?php echo do_shortcode(\'[lightbox id="mitra\' . get_the_author_meta( \'ID\', $q->ID) . \'" width="600px" padding="20px"]
<p>Nama: \'.get_the_author_meta(\'display_name\', $q->ID).\'</p>
<p>Nama Panggilan</p>
<p>Alamat</p>
<p>No Handphone</p>
<p>Upline</p>
<p>Tim</p>
<p>Leader Tim</p>
[/lightbox]\'); ?>

<?php } 
echo \'</ul>\'; ?>

相关推荐