Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <article>
- <?php
- /**
- * Template name: AJAX Encyclopedia
- *
- */
- ?>
- <script type="text/javascript">
- jQuery( document ).on( 'ajaxfinish', easy_fancybox_handler );
- </script>
- <?php
- add_action( 'genesis_entry_content', 'glossary_filter');
- function glossary_filter()
- {
- $args = array(
- 'post_type' => 'encyclopedia_item',
- 'posts_per_page' => -1,
- 'order' => 'ASC',
- 'paged' => get_query_var( 'paged' )
- );
- $query = new WP_Query( $args );
- $tax = 'encyclopedia_category';
- $terms = get_terms( $tax );
- $count = count( $terms );
- if ( $count > 0 ): ?>
- <?php endif;
- if ( $query->have_posts() ): ?>
- <div class="full-width-content">
- <div class="one-half">
- <div class="full-width-content" id="post-content">
- <div id="loading-animation">
- </div>
- </div>
- <div class="full-width-content" id="related-terms">
- related terms
- </div>
- </div>
- <div class="one-half">
- <div class="post-tags">
- <?php
- foreach ( $terms as $term ) {
- $term_link = get_term_link( $term, $tax );
- echo '<a href="' . $term_link . '" class="term-filter" title="' . $term->slug . '">' . $term->name . '</a> ';
- } ?>
- </div>
- <div class="tagged-posts">
- <ul>
- <?php while ( $query->have_posts() ) : $query->the_post(); ?>
- <li class="parent" id="<?php the_ID(); ?>" >
- <a class="ajax-click" href="#"><?php the_title(); ?></a>
- <div class="child">
- <?php the_content() ?>
- </div>
- </li>
- <?php endwhile; ?>
- </ul>
- </div>
- <?php do_action( 'genesis_after_endwhile' ); ?>
- <?php else: ?>
- <div class="tagged-posts">
- <h2>No posts found</h2>
- </div>
- </div>
- </div>
- <?php endif; ?>
- <?php } ?>
- </article>
- <?php
- genesis();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement