在我的原始代码主题中,Post元数据如下所示:
<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 -->
它显示元数据,如:
Post Content here like Lorem Ipsum is simply
dummy text of the printing and typesetting
industry.
____________________________________________
by Author_name
在我的例子中,您可以简单地放置一个条件标记,如:
<?php if( !is_author( \'author_nickname\' ) ) : ?>
<div class="entry-meta">
...
</div>
<?php endif; ?>
Note: 我为所有作者启用了元框,除了某人。我把
author_nickname
在这里,你可以把
author_id
也检查法典:
Codex: Function Reference:is_author()