2018-01-31 20:09
浏览 56


hello experts i have been trying to retrieve data from fields that i created enter image description here

the field name is "ddw" and its repeater and enter image description here

its subfield op1 and it has lots of rows enter image description here

but i am still not able retreive any row by using this code

require_once 'wp-load.php';
require_once ABSPATH . '/wp-admin/includes/taxonomy.php';
include_once 'wp-content/plugins/acf351/acf.php';
// check if the repeater field has rows of data
if( have_rows(get_field('ddw')) ):
    // loop through the rows of data
    while ( have_rows(get_field('ddw')) ) : the_row();

        // display a sub field value
       echo the_sub_field('op1');

else :
    echo 'no rows found';

and it finds no row . i want all rows from every posts and particularly i want http links to put on array and loop through it . i have put this script in wp directory its not theme or template folder. please help me where i am doing wrong .thanks in advance

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题