Highlighting current item of custom post types’ sub pages, listed by wp_list_pages

The below code is for listing the custom post types itself and its children in the sidebar. The code works great but does not highlight the sub pages. In functions.php: if(!function_exists(‘get_post_top_ancestor_id’)){ /** * Gets the id of the topmost ancestor of the current page. Returns the current * page’s id if there is no parent. … Read more

Show just one level of child pages, wp_list_pages woe

I’m working on a site that has a fairly large page structure a few levels deep – in some sections there are a lot of pages. The basic setup is something like this… Parent Parent Parent -Child -Child –Grandchild –Grandchild –Grandchild —GreatGrandchild -Child -Child –Grandchild –Grandchild –Grandchild —GreatGrandchild -Child Parent -Child Parent Parent -Child -Child … Read more

How can I hide children of draft pages using wp_list_pages()?

I’m displaying a simple sitemap with wp_list_pages(); $args = array( ‘sort_column’ => ‘menu_order’, ‘title_li’ => ”, ‘post_status’ => ‘publish’ ); wp_list_pages( $args ); The problem is that by default this also shows the published children of draft pages, like so : Page 1 (published) -> displayed — Page 2 (draft) -> not displayed —— Page … Read more