crazydelta
Member
Posted 6 years ago #
Just want to have the pages to show the last page created to be ON TOP.
I changed
<?php wp_list_pages('sort_column=menu_order&title_li=<h4>' . __('Pages') . '</h4>' ); ?>
to this
<?php wp_list_pages('sort_column=time_created&title_li=<h4>' . __('Pages') . '</h4>' ); ?>
and after doing so I get this error -
WordPress database error: [Unknown column 'time_created' in 'order clause']
SELECT * FROM wp_posts WHERE post_status = 'static' ORDER BY time_created ASC
Please help!
Thanks.
'time_created' was valid only briefly (1.5) for a sort_column value. Try using 'post_date'.
EDIT: Corrected that particular example on Codex:
http://codex.wordpress.org/Template_Tags/wp_list_pages
crazydelta
Member
Posted 6 years ago #
OK, thanks. But I want the newest page to be on top.
"But I want the newest page to be on top."
Yes, hence post_date = time_created.
crazydelta
Member
Posted 6 years ago #
So i've tried
<?php wp_list_pages('post_date=time_created&title_li=<h4>' . __('Pages') . '</h4>' ); ?>
But the result is just that the pages are sorted alphbetically.
*ahem*
<?php wp_list_pages('sort_column=post_date&title_li=<h4>' . __('Pages') . '</h4>' ); ?>
Note what changed above.
crazydelta
Member
Posted 6 years ago #
OH OK. LOL
But still, I am getting the oldest page on top and the newest on the bottom. I want the other way around.
<?php wp_list_pages('sort_column=post_date&sort_order=DESC&title_li=<h4>' . __('Pages') . '</h4>' ); ?>
Good ole' sort_order... :)
crazydelta
Member
Posted 6 years ago #
COOL.
You da man!
Thanks.