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.

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

1 Answer 1

<?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

 
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.