This repository has been archived by the owner. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Content area to private pages index
- Loading branch information
andrewmbacon
committed
Jan 13, 2015
1 parent
25011b5
commit 8c55552
Showing
1 changed file
with
51 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,51 @@ | ||
<?php | ||
/* | ||
* Template Name: List Private Pages | ||
* Description: Template page ment to display private pages. | ||
*/ | ||
|
||
get_header(); ?> | ||
<div id="page-private-list"> | ||
<?php include('inc/sidebar-check.php')?> | ||
<?php while ( have_posts() ) : the_post(); ?> | ||
<?php include('inc/submenu-check.php')?> | ||
<div class="row"> | ||
<div class="col-sm-<?php echo (is_active_sidebar( $sidebar )?9:12); ?>"> | ||
|
||
<?php get_template_part( 'content', 'blank' ); ?> | ||
|
||
<?php | ||
$sort = array(); | ||
$pages = get_pages(array('sort_order' => 'asc', 'sort_column' => 'post_title', 'hierarchical' => false, 'child_of' => get_the_ID())); | ||
if(count($pages) > 0){ | ||
foreach($pages as $key => $page){ | ||
$sort[$key] = $page->post_title; | ||
} | ||
asort($sort); | ||
echo '<ul>'; | ||
foreach( $sort as $key => $title ){ | ||
$pg = $pages[$key]; | ||
$parent = is_parent_private($pg->ID); | ||
if($parent !== false) $page = $parent; | ||
else $page = $pg->ID; | ||
$private = get_post_meta($page, 'uc-private', true); | ||
if(!($private == 'admins' || $private == 'users' || $private == 'list')){ | ||
continue; | ||
} | ||
$title = ucwords($pg->post_title); | ||
echo '<li><a href="'.get_page_link($pg->ID).'" class="az-letter-page">'.$title.'</a></li>'; | ||
|
||
} | ||
echo '</ul>'; | ||
} | ||
?> | ||
|
||
</div> | ||
<?php include('inc/sidebar-if-active.php')?> | ||
</div> | ||
<?php include('inc/submenu-closing-tags.php')?> | ||
<?php endwhile; // end of the loop. ?> | ||
</div> | ||
<?php get_footer(); ?> | ||
<?php | ||
/* | ||
* Template Name: List Private Pages | ||
* Description: Template page ment to display private pages. | ||
*/ | ||
|
||
get_header(); ?> | ||
<div id="page-private-list"> | ||
<?php include('inc/sidebar-check.php')?> | ||
<?php while ( have_posts() ) : the_post(); ?> | ||
<div class="row"> | ||
<div class="col-sm-<?php echo (is_active_sidebar( $sidebar )?9:12); ?>"> | ||
|
||
<div id="primary" class="content-area"> | ||
<main id="main" class="site-main" role="main"> | ||
<?php get_template_part( 'content', 'page' ); ?> | ||
</main> | ||
</div> | ||
|
||
<?php | ||
$sort = array(); | ||
$pages = get_pages(array('sort_order' => 'asc', 'sort_column' => 'post_title', 'hierarchical' => false, 'child_of' => get_the_ID())); | ||
if(count($pages) > 0){ | ||
foreach($pages as $key => $page){ | ||
$sort[$key] = $page->post_title; | ||
} | ||
asort($sort); | ||
echo '<ul>'; | ||
foreach( $sort as $key => $title ){ | ||
$pg = $pages[$key]; | ||
$parent = is_parent_private($pg->ID); | ||
if($parent !== false) $page = $parent; | ||
else $page = $pg->ID; | ||
$private = get_post_meta($page, 'uc-private', true); | ||
if(!($private == 'admins' || $private == 'users' || $private == 'list')){ | ||
continue; | ||
} | ||
$title = ucwords($pg->post_title); | ||
echo '<li><a href="'.get_page_link($pg->ID).'" class="az-letter-page">'.$title.'</a></li>'; | ||
|
||
} | ||
echo '</ul>'; | ||
} | ||
?> | ||
|
||
</div> | ||
<?php include('inc/sidebar-if-active.php')?> | ||
</div> | ||
<?php endwhile; // end of the loop. ?> | ||
</div> | ||
<?php get_footer(); ?> |