我想在我的模板上添加一个链接,以链接到用户自己的博客文章,我尝试使用的代码是<li><a href="?author=<?php the_author_ID(); ?>">test</a></li>
。
编辑,这里的代码有错别字,它带你到的网址只是?author=
它非常简单。
您可以使用WordPress用户列表插件而不是编写代码。
http://wordpress.org/plugins/user-list/
http://wordpress.org/plugins/wordpress-users-list/
你的意思是你只想在URL中打印数字。 只需回显 the_author_ID()。
<li><a href="?author=<?php echo the_author_ID(); ?>">test</a></li>