Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2012
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php if ( get_post_meta($post->ID, 'ecpt_chapters', true) ) : ?>
  2. <?php
  3. $temp = $chapters_query;
  4. $chapters_query= null;
  5. $chapters_query = new WP_Query();
  6. $chapters_query->query('post_type=chapter&order=ASC'); // category slug
  7. $book_slug = basename(get_permalink());
  8. ?> 
  9.  
  10. <?php if ( $chapters_query->have_posts() ) : while ( $chapters_query->have_posts() ) : $chapters_query->the_post(); ?>
  11. <?php $chapter_parent = get_post_meta($post->ID, 'ecpt_chapter_parent', true);
  12.     if ( $chapter_parent == $book_slug ) : ?>
  13.     <li>
  14.         <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>
  15.     </li>
  16.     <?php endif; ?>
  17. <?php endwhile; // end of the loop. ?>
  18. <?php endif; wp_reset_query(); ?>
  19. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement