php - 如何修改继续阅读链接?
问题描述
如果您使用 DOM 在 HTML 中显示您的 RSS,您会在“继续阅读”内容的末尾找到永久链接()。你可以在这里查看我的提要
这是标签结束前的脚本
<p class="link-more"><a href="https://www.eitren.com/blog/products/bagaimana-cara-page-halaman-link-website-di-halaman-pertama-google-search-engine/" class="more-link">Continue reading<span class="screen-reader-text"> "Bagaimana cara page/halaman/link website di halaman pertama Google Search Engine?"</span></a></p>]]></description>
我想修改链接,在链接末尾添加 /AMP/。所以它会变成“...google-search-engine/amp/”类...
解决方案
这取决于您的 RSS 提要设置显示的具体内容。有些显示完整的帖子,有些显示摘录。the_content_more_link
在您的情况下,您可以使用钩子过滤此文本。
function wpse_send_to_amp() { return '继续阅读'; } add_filter('the_content_more_link', 'wpse_send_to_amp');
推荐阅读
- c# - 我如何知道 Excel 应用程序属性已更改(例如:UseSystemSeparator)或已选择自定义选项卡?
- ruby-on-rails - 如何在 Google Cloud Build 中构建 Docker 映像并在后续构建步骤中使用?
- c - 如何在检查变量的函数中使用 printf?
- c# - IEnumerable<> vs List<> 作为参数
- fortran - Valgrind (Helgrind) 误报?
- android - Android:在另一个不发射的情况下收集 Kotlin Flow
- c - 在 C 中将负整数转换为更大的无符号整数
- camera - 将一个盒子从世界投影到图像平面
- r - gsub() 无法识别和替换某些重音字符
- python - 清理列标题的更有效或“pythonic”方式是什么?