【发布时间】:2013-06-03 18:45:24
【问题描述】:
我正在尝试通过作者 ID 将 a 链接到 3 个不同的作者到他们的作者页面。
- (作者/adrian-cole/)
- (作者/steve-helme/)
- (作者/scott-oneill/)
我该怎么做呢?
例子:
<div>Adrian Cole <a href="<?php get_author_posts_url(get_the_author_meta('ID')==1) ?>">Read more</a></div>
<div>Steve Helme <a href="<?php get_author_posts_url(get_the_author_meta('ID')==2) ?>">Read more</a></div>
<div>Scott O'Neill <a href="<?php get_author_posts_url(get_the_author_meta('ID')==3) ?>">Read more</a></div>
这将在 sidebar.php 文件中作为“配置文件小部件”,因此无法从发布帖子的作者那里获取作者 ID
我猜这不会在循环中?错了吗?我是 wordpress 新手哈!
【问题讨论】:
标签: php wordpress get meta author