-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
33 lines (25 loc) · 858 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
get_header();
?>
<?php if ( \PressbooksBook\Helpers\is_book_public() ) : ?>
<section class="block block-toc">
<?php
if ( pb_get_first_post_id() ) :
$loop = new WP_Query( array( 'post_type' => 'chapter', 'posts_per_page' => -1, 'orderby'=> 'title', 'order' => 'ASC' ) ); ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php the_title( '<h2 class="toc"><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h2>' );
// the_excerpt()
?>
<?php endwhile; ?>
<?php
else :
echo apply_filters( 'the_content', __( 'This book does not contain any public content.', 'pressbooks-book' ) );
endif;?>
</section>
<?php else : ?>
<?php get_template_part( 'private' ); ?>
<?php endif; ?>
<?php get_footer(); ?>