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