我试图找到一个特定作者的所有帖子在没有作者框的情况下是如何显示的,而其他所有作者的帖子都有自己的作者框。
有人能帮我吗?
我试图找到一个特定作者的所有帖子在没有作者框的情况下是如何显示的,而其他所有作者的帖子都有自己的作者框。
有人能帮我吗?
在我的原始代码主题中,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
也检查法典:首先,我建议使用子主题并保留原始主题,这样在更新主题时不会丢失任何自定义设置。
然后,如果您实际使用的是子主题,只需将以下内容复制到子主题目录single.php
, 并包装作者div
使用此选项:
if ( get_post_field( \'post_author\', get_queried_object_id() ) != $author_id) :
...
endif;
。。。哪里$author_id
是要隐藏块的作者的ID。如果作者div
是由函数处理的,请在*functions.php
并将其复制到functions.php
(在您的子主题目录中),然后执行上述修改。
我正在使用带有用户链接的wp usersonline插件,当你点击订阅服务器时,它会转到一个找不到的页面,但对作者来说效果很好,我想有没有办法将订阅服务器重定向到配置文件页面并将链接改为http://domain.com/member/profile=ID.我发现一些脚本将重定向到特定的url,但我不知道下一步该怎么做?function new_author_base() { global $wp_rewrite; $author_slug = \'profile\';&#