Widget to display most recent 10 pages published
-
I found this on the forum
<?php $howmany = 10; $pages = wp_list_pages("echo=0&title_li="); $pages_arr = explode("\n", $pages); for($i=0;$i<$howmany;$i++){ echo $pages_arr[$i]; } ?>
Which displays 10 pages in one of the widget area but I need it to show the latest 10 pages. Not sure which 10 it currently shows (I think it is alphanumeric) but it’s not the last 10. Anyone know how to hack this to show the latest 10 pages published and possible a way of excluding certain pages (comma separated possibly)
[Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Widget to display most recent 10 pages published’ is closed to new replies.