Revision: 46497
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at May 20, 2011 19:08 by erikportin
Initial Code
<?php if ( 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 ?>">
Initial URL
Initial Description
Initial Title
Check first parent of page in Wordpress and add body id
Initial Tags
php, wordpress
Initial Language
PHP