一段时间以来,我一直在尝试更改首页中的一些阅读更多按钮
我已经缩小了这个 HTML 文本的范围。
printf('<p>%s</p>', get_the_excerpt($post->ID));
printf('<a href="%s" class="button">Read more</a>', post_permalink($post->ID));
我想知道为什么阅读更多按钮/链接没有 URL? Post ID 是什么意思?
最佳答案
关于 Wordpress variables here 的治疗有很好的信息.在您的情况下,%s 是 printf 中的一个字符串变量,由函数 get_the_excerpt() 和 post_permalink()
这两个函数都使用帖子的 ID(帖子 ID)来检索要打印的结果。
关于html - 在 wordpress 中阅读更多链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27323929/