advanced code snippet search
erikportin on 05/20/11
php wordpress headerphp
05/20/11 07:08pm
<?phpif ( is_page() && $post->post_parent ) {$id = get_the_ID();$a = get_ancestors( $id, 'page' );$root=count($a)-1;$rootId = $a[$root];}else {$rootId = get_the_ID();}?> <body <?php body_class(); ?> id="root-id-<?php echo $rootId ?>">
Report this snippet Tweet
Comment:
You need to login to post a comment.