sometimes i want to use the subpages shortcode outside the loop. when i do this,
$post->idwill return empty. this causes the pagelist to show every single page of the site. 🙁 the correction is simple
global $post, put
and instead of
'child_of' => post->ID
change it to:
'child_of' => $wp_query->post->ID
- The topic ‘subpages doesn't work all the time’ is closed to new replies.