从页面数组中获取自定义字段(acf)


Get custom field (acf) from array of pages - wordpress

我有这个函数来获取具有特定模板的页面:

   $parteneri = get_pages(array(
       'post_type' => 'page',
       'meta_key' => '_wp_page_template',
       'meta_value' => 'template_parteneri.php',
       'meta_compare' => '!='
   ));

返回一个数组。我如何能够访问这些返回页面上的一些自定义字段(高级自定义字段)?

我想你必须在页面之间循环使用

get_post_meta( $post_id, $key, $single );

表示每个自定义字段。

我发现了,我用那个数组做了一个查询。我刚加了:

$queryObject = new WP_Query($pages);?>

            <?php if ( $queryObject->have_posts() )
                while (
                $queryObject->have_posts() ) :
                $queryObject->the_post();
            ?>
            <p><?php the_field('continut_pagina'); ?></p>
            <?php endwhile; ?>