我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

链接到用户博客文章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>

近期文章

  • PayPal的paymentExecStatus值
  • Mysqli查询返回空字符串
  • 从wordpress函数获得结果SQL
  • PHP:合并具有相同标题的数组
  • 需要帮助从SQL中的两个表中获取所有数据
  • facebook用户信息存储在数据库中
  • jQuery ajax返回意外的数据类型
  • 使用jquery动态修改属性
  • Paypal自适应付款处理个人付款
  • Ajax PHP脚本无法正常工作 - 使用php ajax联系方框
  • CLI中的会话是什么?
  • 用于从Facebook中提取的图像库的PHP,仅获取前25个图像
  • Zend_Http_Client SSL异常
  • 如何从每列中获取值并将它们组合成一个循环中的字符串
  • 网页有一个重定向循环
  • 显示存储在数据库中的图像
  • php cookie安全javascript
  • 使用HTML发送电子邮件
  • 忽略表格中隐藏的跨度[重复]
  • 仅当mySQL信息存在时才显示div

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华