Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if ( get_post_meta($post->ID, 'ecpt_chapters', true) ) : ?>
- <?php
- $temp = $chapters_query;
- $chapters_query= null;
- $chapters_query = new WP_Query();
- $chapters_query->query('post_type=chapter&order=ASC'); // category slug
- $book_slug = basename(get_permalink());
- ?>
- <?php if ( $chapters_query->have_posts() ) : while ( $chapters_query->have_posts() ) : $chapters_query->the_post(); ?>
- <?php $chapter_parent = get_post_meta($post->ID, 'ecpt_chapter_parent', true);
- if ( $chapter_parent == $book_slug ) : ?>
- <li>
- <a href="<?php the_permalink(); ?>" rel="bookmark" title="Book: <?php the_title_attribute(); ?>"><?php echo get_post_meta($post->ID, 'ecpt_pretty_title', true); ?></a>
- </li>
- <?php endif; ?>
- <?php endwhile; // end of the loop. ?>
- <?php endif; wp_reset_query(); ?>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement