From ef097a2279bd99c3ad7ee443381b23789a112fac Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 20 Dec 2017 14:32:42 -0500 Subject: [PATCH] Update this again reversing hom I'm getting pages. Now trying to get list of bad pages and then pass to exclude. --- functions.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/functions.php b/functions.php index d9892c7..5634d44 100644 --- a/functions.php +++ b/functions.php @@ -49,8 +49,8 @@ function glm_page_menu($parent = 0, $class = '') 'post_type' => 'page', 'parent' => $parent, 'number' => '', - 'exclude' => "$frontPageId,702", - 'include' => glm_get_visable_page_ids(), + 'exclude' => "$frontPageId,702,".glm_get_notvisable_page_ids(), + 'include' => '', 'post_status' => 'publish', 'sort_order' => 'asc', 'sort_column' => 'menu_order' @@ -96,7 +96,7 @@ function SearchFilter($query) { } add_filter('pre_get_posts','SearchFilter'); -function glm_get_visable_page_ids() +function glm_get_notvisable_page_ids() { static $publishPageIds = array(); //return implode( ',', $publishPageIds ); @@ -104,15 +104,13 @@ function glm_get_visable_page_ids() // Find all pages marked published $publishedPages = get_pages( array( - 'post_type' => 'page', - 'post_status' => 'publish', - 'sort_order' => 'asc', - 'sort_column' => 'menu_order' + 'post_type' => 'page', + 'post_status' => 'publish', ) ); if ( $publishedPages ) { foreach ( $publishedPages as $page ) { - if ( !$page->post_password ) { + if ( $page->post_password ) { $publishPageIds[] = $page->ID; } } @@ -134,7 +132,7 @@ function glm_offcanvas_menu() 'depth' => 0, 'sort_column' => 'menu_order', 'menu_class' => 'left-off-canvas-list', - 'include' => glm_get_visable_page_ids(), + 'exclude' => glm_get_notvisable_page_ids(), )); } -- 2.17.1