Warning: include_once(): open_basedir restriction in effect. File(/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache-phase1.php) is not within the allowed path(s): (/www/wwwroot/www.rixin.info/:/tmp/) in /www/wwwroot/www.rixin.info/www/wp-content/advanced-cache.php on line 22

Warning: include_once(/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache-phase1.php): failed to open stream: Operation not permitted in /www/wwwroot/www.rixin.info/www/wp-content/advanced-cache.php on line 22

Warning: include_once(): Failed opening '/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache-phase1.php' for inclusion (include_path='.:') in /www/wwwroot/www.rixin.info/www/wp-content/advanced-cache.php on line 22

Warning: include(): open_basedir restriction in effect. File(/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache-base.php) is not within the allowed path(s): (/www/wwwroot/www.rixin.info/:/tmp/) in /www/wwwroot/www.rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache.php on line 95

Warning: include(/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache-base.php): failed to open stream: Operation not permitted in /www/wwwroot/www.rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache.php on line 95

Warning: include(): Failed opening '/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache-base.php' for inclusion (include_path='.:') in /www/wwwroot/www.rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache.php on line 95

Warning: include_once(): open_basedir restriction in effect. File(/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/ossdl-cdn.php) is not within the allowed path(s): (/www/wwwroot/www.rixin.info/:/tmp/) in /www/wwwroot/www.rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache.php on line 118

Warning: include_once(/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/ossdl-cdn.php): failed to open stream: Operation not permitted in /www/wwwroot/www.rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache.php on line 118

Warning: include_once(): Failed opening '/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/ossdl-cdn.php' for inclusion (include_path='.:') in /www/wwwroot/www.rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache.php on line 118
wordpress文章页获取作者的标签,the_author(); 不显示怎么办?|网站建设

wordpress文章页获取作者的标签,the_author(); 不显示怎么办?

最近在折腾wordpress,才发现wordpress和zblog有多么的不同...

wordpress文章页获取作者的标签,the_author(); 不显示怎么办?

wordpress里面可自定义的东西太多了,没有一个统一的标准,wordpress版本有多,版本之间的调用方法又有差异,你在网上搜到的教程可能是老版本才能有新版本根本用不了...

非常头疼。

例如wordpress文章页获取作者的标签这个东西,网上的教程都是“<?php the_author(); ?> ”,但是这个标签只在循环里面才能用,你要在single.php里面是用不了的,输出是空白。

所以用啥标签呢?最后才查到用“get_the_author_meta()”这个函数来实现。使用方法如下:

<php echo get_the_author_meta( 'display_name', $post->post_author ) ?>

函数有以下几种调用参数:

user_login(用户登录名)
user_pass(用户登录密码)
user_nicename(用户昵称)
user_email(用户邮箱地址)
user_url(用户网站地址)
user_registered(用户注册时间)
user_status(用户状态)
display_name(作者显示的名称)
nickname(作者昵称)
first_name(作者名字)
last_name(作者姓氏)
description(作者描述)
user_level(用户等级)
user_firstname(用户名字)
user_lastname(用户姓氏)
user_description(用户描述)

wordpress文章页获取作者的标签,the_author(); 不显示怎么办?:等您坐沙发呢!

发表评论

表情
还能输入210个字