I basically want to do the same thing; I tried
<?php
$pageid = get_query_var('page_id');
?>
but it always returns “0”
see below – the only thing that is unique to each of the pages I call is the actual page name.
‘Array
(
[pagename] => kaiserslautern
[error] =>
[m] => 0
[p] => 0
[post_parent] =>
[subpost] =>
[subpost_id] =>
[attachment] =>
[attachment_id] => 0
[name] => kaiserslautern
[hour] =>
[static] =>
[page_id] => 0
[second] =>
[minute] =>
[day] => 0
[monthnum] => 0
[year] => 0
[w] => 0
[category_name] =>
[tag] =>
[cat] =>
[tag_id] =>
[author_name] =>
[feed] =>
[tb] =>
[paged] => 0
[comments_popup] =>
[meta_key] =>
[meta_value] =>
[preview] =>
[category__in] => Array
(
)
[category__not_in] => Array
(
)
[category__and] => Array
(
)
[post__in] => Array
(
)
[post__not_in] => Array
(
)
[tag__in] => Array
(
)
[tag__not_in] => Array
(
)
[tag__and] => Array
(
)
[tag_slug__in] => Array
(
)
[tag_slug__and] => Array
(
)
[caller_get_posts] =>
[suppress_filters] =>
[post_type] =>
[posts_per_page] => 20
[nopaging] =>
[comments_per_page] => 50
[order] => DESC
[orderby] => wp_RAW_posts.post_date DESC
)’
The reason I want to do this is because depending on the page I am in I want to create a lit of child pages of the current page I’m browsing using wp_list_pages – I may be over-thinking it and there may be a simpler solution…