From 1492aa0266636ba7a75b35466b7e6adde2eb2dd5 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 20 Dec 2017 14:15:27 -0500 Subject: [PATCH] Work on dev55 to get it working wierdness on dev55 --- functions.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/functions.php b/functions.php index 101ebbf..cbb83c3 100644 --- a/functions.php +++ b/functions.php @@ -99,21 +99,27 @@ add_filter('pre_get_posts','SearchFilter'); function glm_get_visable_page_ids() { static $publishPageIds = array(); + //return implode( ',', $publishPageIds ); if ( empty( $publishPageIds ) ) { // Find all pages marked published $publishedPages = get_pages( array( 'post_type' => 'page', 'post_status' => 'publish', + 'sort_order' => 'asc', ) ); - foreach ( $publishedPages as $page ) { - if ( !$page->post_password ) { - $publishPageIds[] = $page->ID; + if ( $publishedPages ) { + foreach ( $publishedPages as $page ) { + if ( !$page->post_password ) { + $publishPageIds[] = $page->ID; + } } } + return implode( ',', $publishPageIds ); + } else { + return ''; } - return $publishPageIds; } /** -- 2.17.1