Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Functions

By: a guest on Feb 1st, 2013  |  syntax: PHP  |  size: 0.32 KB  |  views: 40  |  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. }
clone this paste RAW Paste Data