0

Some what i have this code working perfectly, the problem is not excluding subscriber from the list, can somebody help me to exclude subscriber from the list.. 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

working code ..thx @michael

<?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>'; ?>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.