简体   繁体   中英

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> .

Edit, had a typo on the code on here and the url that it takes you to is just ?author=

Its very simple.

you can use wordpress user list plugins instead of writing codes.

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

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

Did you mean you want to print number only in the URL. just echo the_author_ID().

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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