subpages doesn't work all the time
-
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 simpleinstead of
global $post, putglobal $wp_queryand instead of
'child_of' => post->ID
change it to:'child_of' => $wp_query->post->ID
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘subpages doesn't work all the time’ is closed to new replies.