1 回答

TA貢獻2021條經驗 獲得超8個贊
您可以添加用于編輯這些字段的選項頁面:
if (function_exists('acf_add_options_page')) {
acf_add_options_page(array(
'page_title' => 'Theme General Settings',
'menu_title' => 'Theme Settings',
'menu_slug' => 'theme-general-settings',
'capability' => 'edit_posts',
'redirect' => false
));
}
然后在此選項頁面上顯示此字段組。
至于顯示值,您需要像這樣添加第二個參數“option”:
<?php
if( have_rows('actiedagen', 'option') ):
while ( have_rows('actiedagen', 'option') ) : the_row();
the_sub_field('actiedagen_titel'); // no need to add option here
the_sub_field('actiedagen_datum');
the_sub_field('actiedagen_locatie');
endwhile;
else :
endif;
?>
- 1 回答
- 0 關注
- 112 瀏覽
添加回答
舉報