/ Published in: PHP

Plugin gets child pages of parent in Wordpress. You'll need to pass the parent ID but this isn't difficult to figure out programmatically if needed, either.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php // Include Wordpress framework/API require_once( '/path/to/wp-load.php' ); // Get parents (level one) $items_level_one = $wpdb->get_results( 'SELECT * FROM wp_posts WHERE post_type = "Page" AND post_status = "Publish" AND post_parent = "[put parent id here]" ORDER BY menu_order, post_title', ARRAY_A ); ?>
Comments
