From: Steve Sutton Date: Wed, 20 Dec 2017 19:15:27 +0000 (-0500) Subject: Work on dev55 to get it working X-Git-Tag: v1.0.6^2~4 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=1492aa0266636ba7a75b35466b7e6adde2eb2dd5;p=WP-Themes%2FAdelaineConstruction.git Work on dev55 to get it working wierdness on dev55 --- 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; } /**