![](/img/trans.png)
[英]How to insert a custom code between the posts inside the Wordpress loop?
[英]Where to insert code for custom sorting posts in WordPress
我正在按照高级自定义字段插件按 Wordpress 中的自定义字段值对帖子进行排序: https://www.advancedcustomfields.com/resources/orde-posts-by-custom-fields/
我的问题是,我应该在主题编辑器上的哪些文件(.php)中插入代码片段?
如果它的 wp_query 或 get_posts 您可以将它们直接插入到您希望它们出现的模板/帖子/页面文件中(或者您可以为它们创建 function)。
如果您使用的是 pre_get_posts,则需要将其添加到 functions.php 文件中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.