Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Functions

By: a guest on Feb 1st, 2013  |  syntax: PHP  |  size: 0.32 KB  |  hits: 38  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // Subpage Shortcode
  2. function is_child($page_id_or_slug) {
  3.         global $post;
  4.         if(!is_int($page_id_or_slug)) {
  5.                 $page = get_page_by_path($page_id_or_slug);
  6.                 $page_id_or_slug = $page->ID;
  7.         }
  8.         if(is_page() && $post->post_parent == $page_id_or_slug ) {
  9.                 return true;
  10.         } else {
  11.                 return false;
  12.         }
  13. }