Categories

0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>

get_results("SELECT $wpdb->posts.ID,$wpdb->posts.post_title,$wpdb->term_relationships.object_id,$wpdb->term_relationships.term_taxonomy_id,$wpdb->term_taxonomy.term_id FROM $wpdb->posts,$wpdb->term_relationships,$wpdb->term_taxonomy WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_type = 'page' AND $wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id AND $wpdb->term_taxonomy.term_id = $cat"); return $pages; } // Lists all categories, with a sublist of pages under each category. function cw_listcategories() { global $wpdb; $categories = get_categories('hide_empty=0'); foreach($categories as $category) { $catid = $category->cat_ID; echo '

'.$category->name.'

'; echo ''; } } add_action('edit_page_form','cw_pagecategories_form',10);