Limit the amount of main pages

Won’t it make more sense to limit number of pages that navigation displays? There are many instances when page is not wanted in navigation but still needed somewhere (I have privacy policy set up this way at my blog for example).

Custom theme – pages in menu

Since version 3.0 WordPress includes new menu system. It allows to setup menu items in administration area easily and associate menus with specific places in theme templates. It outputs decent list-based markup (pre-filled with classes) that you can style with CSS (and customize if needed). See Navigation Menus for where to start.

Prompting for review / reapproval of page content

I tend to look for simple solutions so my suggestion is to query pages, sort by modified day and display in Dashboard widget. add_action( ‘wp_dashboard_setup’, ‘add_old_pages_widget’ ); function add_old_pages_widget() { wp_add_dashboard_widget( ‘oldpages’, ‘Oldest Pages’, ‘old_pages’ ); } function old_pages() { $pages = get_pages( array( ‘sort_column’ => ‘post_modified’ ) ); echo ‘<ul>’; foreach ( $pages as … Read more

return page name in url

To display title of current page you use the_title() template tag. Related and slightly more specific functions are: get_the_title() that returns title without echoing and can retrieve title of another page/post, given its ID as input; the_title_attribute() that returns a little more cleaned up version (safer to use in link titles without breaking markup and … Read more

WordPress: query pages except remove one page

Update: You must use exclude the page using post__not_in paremeter. Rewrite your query using the array parameters query_posts(array( ‘post__not_in’=>array(‘271’), ‘post_parent’=>6, ‘post_type’=>’page’ ) ); See this page for reference.

Identify that a page is a grandchild page

use get_page twice like this handy little function function get_grandpapa($page_id){ $current_page = get_page( $page_id ); if ($current_page->post_parent > 0){ //has at least a parent $parent_page = get_page($current_page->post_parent); if ($parent_page->post_parent > 0){ return $parent_page->post_parent; }else{ return false; } } return false; } This function returns the grandparent page ID or false if there is no grandparent.