0
我在这里有一个情况,我得到的数组自定义字段不正确。我可以知道如何让所有自定义字段顺序吗?按照顺序在wordpress上显示自定义字段
,我用它来获取自定义阵列功能是:
$title = get_post_meta($post_id, "cap-display_name", false);
foreach($title as $a){
echo 'hello '.$a.'<br><br>';
}
但是,我得到的输出是:
hello this is first
hello this is second
hello this is third
hello this is six
hello this is four
hello this is five
hello this is seven
假想的输出是:
hello this is first
hello this is second
hello this is third
hello this is four
hello this is five
hello this is six
hello this is seven
我可以知道如何获得上述输出吗?
的print_r($标题)将得到这样的:
阵列([0] =>这是第一个[1] =>这是第二[2] =>这是第三[3] =>这是六[4] =>这是四[5] =>这是五[6] =>这是七)
显示数组的结构'print_r($ title)'' – Dinesh