Bill,
Hi again. Where can we add the following code to display child pages on parent page, in our case: “News” with post ID->11:
$post->ID,
‘post_type’ => ‘page’
);
$subpages = new WP_query($args);
// create output
if ($subpages->have_posts()) :
$output = ‘
‘;
else :
$output = ‘
No subpages found.
‘;
endif;
// reset the query
wp_reset_postdata();
// return something
return $output;
}
// turn the function into a shortcode
add_shortcode(‘subpage_peek’, ‘subpage_peek’);
?>
It’s has worked perfectly for others and not sure why it doesn’t work on our site. We’ve tried the code on page.php and page-full.php but no luck. We’ve tried various available parent-children codes on wordpress.org but still no success. We tried on function.php but it was “fatal” but luckily got the site back.
Need your help.