简体   繁体   English

链接到用户博客文章wordpress

[英]Link to users blog posts wordpress

I would like to add a link on my template to link to the users own blog posts the code i have tried using is <li><a href="?author=<?php the_author_ID(); ?>">test</a></li> . 我想在模板上添加一个链接,以链接到用户自己的博客文章,我尝试使用的代码是<li><a href="?author=<?php the_author_ID(); ?>">test</a></li>

Edit, had a typo on the code on here and the url that it takes you to is just ?author= 编辑,此处的代码有错别字,带您进入的URL只是?author=

Its very simple. 非常简单。

you can use wordpress user list plugins instead of writing codes. 您可以使用wordpress用户列表插件来代替编写代码。

http://wordpress.org/plugins/user-list/ http://wordpress.org/plugins/user-list/

http://wordpress.org/plugins/wordpress-users-list/ http://wordpress.org/plugins/wordpress-users-list/

Did you mean you want to print number only in the URL. 您是不是要只在URL中打印数字。 just echo the_author_ID(). 只需回显the_author_ID()。

<li><a href="?author=<?php echo the_author_ID(); ?>">test</a></li>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM