我一直堅持幾個小時試圖從wordpress訂購get_pages()
對象。如何訂購多維數組PHP
我需要訂購menu_order
(get_pages->menu_order
);
我一直在嘗試幾個PHP函數,但都沒有在這樣的目的工作。
PHP
foreach(get_pages(pll_current_language()) as $page) {
// Somewhere here each page should go up/down in order to be DESC/ASC
$template = get_post_meta($page->ID, '_wp_page_template', true);
include_once($template);
}
我的問題是,如何訂購其價值的一個這個對象, 例如:
我要訂購get_pages()由get_pages( ) - > menu_order
任何幫助將不勝感激。
只是用從文檔的'$ args'選擇? https://codex.wordpress.org/Function_Reference/get_pages – 0x13a
謝謝@DiegoMariani,它工作得如此甜蜜。我應該更頻繁地檢查文檔。所有最好的隊友:) – Vladimir
歡迎:) – 0x13a