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.

page template – undefined structure in source code

Search all your theme and plugin files for: <!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN” Disable all plugins and re-enable them step by step. This document type declaration is not part of WordPress’ core files; there is a filter active somewhere. Update Try to remove all filters from the affected functions. Start with wp_list_pages(): remove_all_filters( … Read more

list child-pages as normal pages?

you can use get_pages() function, something like this: $mypages = get_pages(); echo ‘<ul>’; foreach($mypages as $page){ echo ‘<li class=”page_item page-item-‘.$page->ID.'”><a href=”‘.get_page_link($page->ID).'”>’.$page->post_title.'</a></li>’; } echo ‘</ul>’;

Problems in creating a static site with WordPress

First, check your permalink settings: Dashboard -> Settings -> Permalinks Second, check to ensure you don’t somehow have a Page slug conflict. Go to Dashboard -> Pages, click the “Trash” tab, and ensure you don’t have any Pages in the trash (if so, delete them if you don’t need them). Third, check the page-slug for … Read more

upgrade has caused page content to disappear

If content displays within WordPress itself when you are logged into the dashboard but does not display on the front end of your site it is almost always a theme problem. If you have access to server logs, such as error logs in cPanel, you can see what errors are being thrown up. The easy … Read more