Probably pretty simple and more PHP-related than pure WP, but how would one pass the $page_id generated in the first code snip into the new WP_Query () in the second code snip?
What I need to do - in a page template - is dynamically get the current page ID and pass that to the new WP_Query in order to display content for that current page. This is for a page template that will display different content according to the page_id, somewhat opposite of what a page template usually does with the loop.
I don't need pagination or anything else; the new queries will display small amounts of content in a jQuery UI tab structure.
Global wp_query to get current page ID (and echo it for testing purposes):
<?php global
$wp_query;
$page_id = $wp_query->get_queried_object_id();
echo $page_id; ?>
Standard new WP_Query for the content:
<?php $my_query = new WP_Query( **need $page_ID here** ); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>