Support » Fixing WordPress » Excluding users on author list page

  • Resolved achaplin


    Is it possible to exclude users from an author page? Below is the code for the page:

    // Template Name: Authors List
    get_header(); ?>
    <style type='text/css'>
    .author {  }
    .author h3 { margin-bottom: 10px; }
    .author .description { overflow: hidden; }
    .author .description p { margin: 0; }
    .author .avatar { }
    .author h4 { font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    	font-size: 21px;
    	color: #145A84;
    	text-align: left;
    	margin: 0px;
    	padding: 0px;
    	line-height: 21px; }
    .author .connect { border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; list-style: none; margin: 0; padding: 0; width: 100%; overflow: hidden; padding: 10px 0px; }
    .author .connect li { float: left; margin-right: 20px; }
    <div class="maincontent" id="maincontent">
    <div class="latestentries" id="latestentries">
    <div class="contentheader" id="contentheader">
    <div class="colorblock" id="colorblock"></div>
    <span class="typepadding">CONTRIBUTORS</span></div>
    <div class="entry" id="entry">
    		$authors = $wpdb->get_results('SELECT DISTINCT post_author FROM '.$wpdb->posts);
    		foreach($authors as $author):
    <div class='author' id='author-<?php the_author_meta('user_login', $author->post_author); ?>'>
    <div class="posticonbox" id="posticonbox"><?php echo get_avatar(get_the_author_meta('user_email', $author->post_author), 50); ?></div>
    <div class="post" id="post">
    <h4><?php the_author_meta('display_name', $author->post_author); ?></h4>
    <?php if(get_the_author_meta('description', $author->post_author)): ?>
    <div class='description'>
    <p><?php the_author_meta('description', $author->post_author); ?></p>
    <?php endif; ?>
    			$recentPost = new WP_Query('author='.$author->post_author.'&showposts=1');
    			while($recentPost->have_posts()): $recentPost->the_post();
    <br />
    <li>Recent Post: <a href='<?php the_title();?>'><?php the_title(); ?></a></h4></li>
    <li">view all posts by <?php the_author_posts_link(); ?></li>
     <?php endwhile; ?>
    <?php if(get_the_author_meta('twitter', $author->post_author) || get_the_author_meta('facebook', $author->post_author) || get_the_author_meta('linkedin', $author->post_author) || get_the_author_meta('digg', $author->post_author) || get_the_author_meta('flickr', $author->post_author)): ?>
    <ul class='connect'>
    <?php if(get_the_author_meta('twitter', $author->post_author)): ?>
    <li class="ulstyle"><a href='<?php the_author_meta('twitter', $author->post_author); ?>'>Twitter</a></li>
    <?php endif; ?>
    <?php if(get_the_author_meta('facebook', $author->post_author)): ?>
    <li class="ulstyle"v><a href='<?php the_author_meta('facebook', $author->post_author); ?>'>Facebook</a></li>
    <?php endif; ?>
    <?php if(get_the_author_meta('linkedin', $author->post_author)): ?>
    <li class="ulstyle"><a href='<?php the_author_meta('linkedin', $author->post_author); ?>'>LinkedIn</a></li>
    <?php endif; ?>
    <?php if(get_the_author_meta('digg', $author->post_author)): ?>
    <li class="ulstyle"><a href='<?php the_author_meta('digg', $author->post_author); ?>'>Digg</a></li>
    <?php endif; ?>
    <?php if(get_the_author_meta('flickr', $author->post_author)): ?>
    <li class="ulstyle"><a href='<?php the_author_meta('flickr', $author->post_author); ?>/'>Flickr</a></li>
    <?php endif; ?>
    <?php endif; ?>
    <div class="border" id="border"></div>
    <?php endforeach; endif; ?>
    </div><!--end post-->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
  • The topic ‘Excluding users on author list page’ is closed to new replies.