DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Get Current Page Id In Wordpress

11.12.2009
| 44888 views |
  • submit to reddit
        
$this_page_id = get_query_var('page_id')

UPDATE
In index.php etc. page is 
$post
 and page_id is 
$post->ID

EXAMPLE USE
$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");