Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Adding featured image support back
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmbacon committed Jan 15, 2015
1 parent 594391c commit dc9703b
Show file tree
Hide file tree
Showing 2 changed files with 325 additions and 326 deletions.
194 changes: 97 additions & 97 deletions content-az.php
Original file line number Diff line number Diff line change
@@ -1,97 +1,97 @@
<?php
/**
* The template used for displaying page content in page.php
*
* @package cornerstone
*/

$exclude = get_post_meta(get_the_ID(), 'exclude', 'true');
$pattern = '#[A-Za-z|~`!@\#$%^&*()_+=|\\}\][{\'/;\-":?>.<]#';
?>


<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?>>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header -->

<div class="entry-content">
<?php the_content(); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'cs' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->

<div id="az-index" class="clearfix">
<?php
function getChars(){
$pages = get_pages();
$letters = array();
foreach( (array) $pages as $pg ){
$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);
$char = $title{0};
if( !(is_numeric($char)) && !in_array($char, $letters) ){
array_push($letters, $char);
}
}
return $letters;
}
// Generate AZ Navigation
echo '<nav class="btn-group">';
$anchors = getChars();
foreach( range('A', 'Z') as $char ){
if( in_array( $char, $anchors ) ){
echo '<a href="#'.$char.'-pages" class="btn btn-default">'.$char.'</a>';
} else {
echo '<span class="btn btn-default disabled">'.$char.'</span>';
}
}
echo '</nav>';
// Generate AZ List
$pages = get_pages(array('sort_order' => 'asc', 'sort_column' => 'post_title', 'hierarchical' => false, 'exclude' => $exclude));
if( !preg_match($pattern, $exclude, $matches) ){
$letters = array();
echo '<section class="letter-directory">';
foreach( (array) $pages as $pg ){
$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);
$char = $title{0};
if( !( is_numeric($char) || empty($char) ) ){
if( $char != end($letters) && !empty($letters) ){
echo '</ol></div>';
}
if( !in_array($char, $letters) ){
echo '<div class="az-letter"><a name="'.$char.'-pages" class="az-anchor"></a><h2 id="'.$char.'-pages az-letter-title"><span class="az-letter">'.$char.'</span></h2><ol class="az-letter-list">';
array_push($letters, $char);
}
echo '<li><a href="'.get_page_link($pg->ID).'" class="az-letter-page">'.$title.'</a></li>';
}
}
echo '</ol></div></section>';
} else {
echo '<p>Invalid input in field: "exclude"</p>';
}
?>
</div>
<footer class="entry-footer">
<?php edit_post_link( __( 'Edit', 'cs' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->
<?php
/**
* The template used for displaying page content in page.php
*
* @package cornerstone
*/

$exclude = get_post_meta(get_the_ID(), 'exclude', 'true');
$pattern = '#[A-Za-z|~`!@\#$%^&*()_+=|\\}\][{\'/;\-":?>.<]#';
?>


<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?>>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header -->

<div class="entry-content">
<?php the_content(); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'cs' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->

<div id="az-index" class="clearfix">
<?php
function getChars(){
$pages = get_pages();
$letters = array();
foreach( (array) $pages as $pg ){
$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);
$char = $title{0};
if( !(is_numeric($char)) && !in_array($char, $letters) ){
array_push($letters, $char);
}
}
return $letters;
}

// Generate AZ Navigation
echo '<nav class="btn-group">';
$anchors = getChars();
foreach( range('A', 'Z') as $char ){
if( in_array( $char, $anchors ) ){
echo '<a href="#'.$char.'-pages" class="btn btn-default">'.$char.'</a>';
} else {
echo '<span class="btn btn-default disabled">'.$char.'</span>';
}
}
echo '</nav>';

// Generate AZ List
$pages = get_pages(array('sort_order' => 'asc', 'sort_column' => 'post_title', 'hierarchical' => false, 'exclude' => $exclude));
if( !preg_match($pattern, $exclude, $matches) ){
$letters = array();
echo '<section class="letter-directory">';
foreach( (array) $pages as $pg ){
$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);
$char = $title{0};
if( !( is_numeric($char) || empty($char) ) ){
if( $char != end($letters) && !empty($letters) ){
echo '</ol></div>';
}
if( !in_array($char, $letters) ){
echo '<div class="az-letter"><a name="'.$char.'-pages" class="az-anchor"></a><h2 id="'.$char.'-pages az-letter-title"><span class="az-letter">'.$char.'</span></h2><ol class="az-letter-list">';
array_push($letters, $char);
}
echo '<li><a href="'.get_page_link($pg->ID).'" class="az-letter-page">'.$title.'</a></li>';
}
}
echo '</ol></div></section>';
} else {
echo '<p>Invalid input in field: "exclude"</p>';
}
?>
</div>
<footer class="entry-footer">
<?php edit_post_link( __( 'Edit', 'cs' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->
Loading

0 comments on commit dc9703b

Please sign in to comment.