php - 如何使用带有自定义字段标题的 wp_list_pages() 函数从自定义帖子类型中列出帖子?
问题描述
问题
我想使用wp_list_pages()函数列出来自自定义帖子类型的帖子。另外,我想使用自定义字段来代替帖子的标题。
目前,我正在使用以下代码来执行此操作,但它不包含 current_post 类。
$posts_list = new WP_Query($args);
while($posts_list->have_posts()){
$posts_list -> the_post();
the_field('custom_field_title');
wp_reset_query();
//currently there is no endwhile, yet loop is working
请建议我一个合适的解决方案。谢谢。这是页面链接:页面链接
解决方案
推荐阅读
- java - 无法使用 Mockito 模拟呼叫
- selenium - 从 svg 交互式地图中获取链接
- javascript - 触发 Click 事件将 Retrun true 但不起作用
- loops - Jmeter:Jmeter 中的地图
- wso2 - 更改 deploymen.toml 以暂停帐户
- sql - 输入表(T2)中的所有数据插入表(T1)中针对每一行T1
- javascript - fullcalendar Angular 11 缺少 main.css 文件
- c++ - 如何修复不想启动的计时器?
- typescript - 如何防止元组的并集变成并集的元组?
- java - 调用者或被调用者应该访问对象字段吗?(爪哇)