Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
19322e055c
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
58 lines (53 sloc) 2.14 KB
<?php
/*
* Template Name: List Private Pages
* Description: Template page ment to display private pages.
*/
get_header(); ?>
<?php include('inc/sidebar-check.php')?>
<div class="row">
<div class="span12">
<div class="row-fluid" id="primary">
<div class="span<?php echo (is_active_sidebar( $sidebar )?9:12); ?>">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post content clearfix" id="post-<?php the_ID(); ?>">
<h2>
<?php the_title(); ?>
</h2>
<div class="post-content">
<?php the_content(); ?>
</div>
<div class="entry">
<?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>
</div>
<?php endwhile; endif; ?>
</div></div>
<?php include('inc/sidebar-if-active.php')?>
</div>
</div>
</div>
<?php get_footer(); ?>