Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am trying to find how all posts of a specific author will appear without the author box, while all the others authors posts will have their author boxes.

Can somebody help me with this?

share|improve this question
    
How do your show the author information? Add the code to your question. –  toscho Aug 19 '13 at 12:27

1 Answer 1

In my theme with raw codes, Post Meta Data are shown like:

<div class="entry-meta">
   <span class="meta-prep meta-prep-author"><?php _e('By ', 'your-theme'); ?></span>
   <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( false, $authordata->ID, $authordata->user_nicename ); ?>" title="<?php printf( __( 'View all posts by %s', 'your-theme' ), $authordata->display_name ); ?>"><?php the_author(); ?></a></span>
</div><!-- .entry-meta -->

It displays the meta data like:

Post Content here like Lorem Ipsum is simply
dummy text of the printing and typesetting
industry.
____________________________________________
by Author_name

In my case, you can simply put a conditional tag like:

<?php if( !is_author( 'author_nickname' ) ) : ?>
   <div class="entry-meta">
      ...
   </div>
<?php endif; ?>

Note: I enabled the meta-box for all author, except someone. I put the author_nickname here, you can put the author_id too. Check the Codex:

Codex: Function Reference:is_author()

share|improve this answer
    
It didn't worked. Perhaps because my theme is more complicated. Here is the code for bio box in single.php. Please have a look again: <div id="authorbox"> <div id="authorimg"> <?php $authoravatar = get_avatar( get_the_author_meta('email'), $size = '80'); ?> <?php if ($authoravatar !== NULL) { ?> <?php echo $authoravatar; ?> <?php } ?> </div> <div id="authorbioname"> <h2><?php the_author_posts_link(); ?></h2> </div> <div id="authorbio"> <p><?php the_author_meta('description'); ?></p> </div> <div id="authorsocial"> <?php $facebook = get_the_author_meta( 'facebook' ); ?> .... </div> </div> –  Kaskarino Aug 19 '13 at 12:21
    
Have you tried embracing your parent div with the code I suggestd, like this: <?php if( is_author() ) : ?><div id="authorbox">...</div><?php endif; ?>? –  Mayeenul Islam Aug 20 '13 at 8:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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