WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to use the author ids (or names) to echo different output for different authors (in this case author id 7 and author admin? I tried the following but it didn't work.

    ?php if (get_the_author_meta(7)) {echo '<a href="<?php the_permalink(); ?>" >'; 
     echo'<?php echo get_post_meta($post->ID, "Thumbnail", true);?>'; echo '</a>';} else {
    echo '<a href="<?php the_permalink(); ?>" ><img src="<?php echo get_post_meta($post->ID, "Thumbnail", true);?>"/></a>';  } ?><?php  ?>
share|improve this question
<?php if (get_the_author_meta('ID') == 7) : ?>
    Do something for user with ID 7.
<?php else : ?>
    Do something for anybody else.
<?php  endif; ?>

Try this, where 7 is the ID of the user.

share|improve this answer

Your Answer


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.