Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Applications
- */
- get_header(); ?>
- <div id="ppagewrapper" >
- <?php
- //list terms in a given taxonomy
- $taxonomy = 'apptypes';
- $appargs=array(
- 'hide_empty' => false,
- 'orderby' => 'name',
- 'order' => 'ASC',
- 'parent' => '0'
- );
- $appterms = get_terms($taxonomy,$appargs);
- ?>
- <?php
- foreach ($appterms as $appterm) {
- $termID = $appterm->term_id;
- $taxonomyName = $taxonomy;
- $termchildren = get_term_children( $termID, $taxonomyName );
- foreach ($termchildren as $child) {
- $termsub = get_term_by( 'id', $child, $taxonomyName );
- echo '<div style="margin:0 auto; width="100%"><h2>'. $appterm->name.'</h2></div>';
- echo $termsub->name;
- $wpq = array ('taxonomy'=>$taxonomy,'term'=>$termsub->slug);
- $query = new WP_Query ($wpq);
- $article_count = $query->post_count;
- echo '<table width="98%" border="0" cellspacing="0" cellpadding="5" class="customtable">
- <tr class="customhead">
- <td align="left" valign="top">Year</td>
- <td align="left" valign="top">Kit Name</td>
- <td align="left" valign="top">Kit</td>
- </tr>
- <tr><td colspan="3">'.term_description($termsub->term_id,$taxonomyName) .'</td></tr>';
- if ($article_count) {
- $posts = $query->posts;
- foreach ($posts as $post) {
- include(MY_THEME_FOLDER . '/appsloop.php');
- }
- }
- echo ' </table>';
- } }
- ?>
- </ul>
- </div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement