Php 页面模板的高级自定义字段

Php 页面模板的高级自定义字段,php,wordpress,templates,advanced-custom-fields,Php,Wordpress,Templates,Advanced Custom Fields,Wordpress ACF->查询页面模板而不是帖子 因此,基本上,我已经设置了高级自定义字段,我想构建我的网站,这样当我创建一个页面模板为“主题页面”的页面时,我希望ACF将自定义字段添加到所有页面模板为“主题页面”的页面中 在过去,我会使用$args数组来查询post_type='slug';但是,如何查询页面模板 查询职位类型的现有代码: $args = array( 'post_type' = 'the name of the post type' ); $args = new WP_Q

Wordpress ACF->查询页面模板而不是帖子

因此,基本上,我已经设置了高级自定义字段,我想构建我的网站,这样当我创建一个页面模板为“主题页面”的页面时,我希望ACF将自定义字段添加到所有页面模板为“主题页面”的页面中

在过去,我会使用$args数组来查询post_type='slug';但是,如何查询页面模板

查询职位类型的现有代码:

$args = array( 'post_type' = 'the name of the post type' ); $args = new WP_Query( $args );
所以我想修改它,以便能够引用页面模板中的字段


谢谢。

要查询页面,您可以将帖子类型设置为“页面”:

'post_type' => 'page'