schaefermic
Member
Posted 2 years ago #
Im using the wp_page_menu command to display the list of all pages I have on the my site on a template page. The only issue is that when i sort by post_date, it displays the oldest first, instead of the newest page.
Currently I'm using:
<?php wp_page_menu( array( 'sort_column' => 'post_date' ) ); ?>
Is there any to reverse this order? im no php wizard.
schaefermic
Member
Posted 2 years ago #
anyone know if there is a fix for this?
Even though it is not shown in the Codex, I think you can use this:
<?php wp_page_menu( array( 'sort_column' => 'post_date', 'sort_order' => 'ASC' ) ); ?>
The documentation for wp_list_pages, which is called by wp_page_menu, says that 'ASC' is the default, so you might also try 'DESC'. That sounds wrong to me because older dates ought to be smaller but maybe post_date is being recalculated to mean post_age.
schaefermic
Member
Posted 2 years ago #
Ahhh, that'll do it!
DESC got it to start with the newest.
Thanks SO much!