admin管理员组文章数量:1122846
<?php
$inner_page_builder = get_field("inner_page_builder_modules"); //group field
if ($inner_page_builder) {
$main_content = $inner_page_builder["main_content"]; //flexible content field
?>
<div class="container">
<div class="main-content">
<?php
echo "<pre>" . var_dump($main_content) . "</pre>"; // gives me below output:
/*
array(2) {
[0]=>
array(2) {
["acf_fc_layout"]=>
string(9) "text_copy"
["text"]=>
string(330) "<p>You know discne focus. All day. Every day. At every implementation. Because focus drives excellence</p>
"
}
[1]=>
array(5) {
["acf_fc_layout"]=>
string(10) "inline_cta"
["cta_position"]=>
string(4) "Left"
["cta_title"]=>
string(11) "Contact now"
["cta_description"]=>
string(29) "know more about us to contact"
["cta_button"]=>
array(3) {
["title"]=>
string(20) "Test stepping stones"
["url"]=>
string(69) "/approach/steppingstones/test-stepping-stones/"
["target"]=>
string(0) ""
}
}
}
<pre></pre>
*/
if (have_rows('main_content')) :
while (have_rows('main_content')) : the_row();
echo "yo";
endwhile;
else :
// no layouts found
endif;
?>
</div>
</div>
<?php
}
本文标签: ACFnot able to loop through flexible content field which is inside a group field
版权声明:本文标题:ACF - not able to loop through flexible content field which is inside a group field 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736304978a1932426.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论