使用MySQL SELECT查询获取父级的子级
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用MySQL SELECT查询获取父级的子级相关的知识,希望对你有一定的参考价值。
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.
<?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 ); ?>
以上是关于使用MySQL SELECT查询获取父级的子级的主要内容,如果未能解决你的问题,请参考以下文章