dragunoff

[WP][Thematic]Template Name: Child Pages Loop

Mar 15th, 2011
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.81 KB | None | 0 0
  1. <?php
  2. /*
  3.  
  4. Template Name: Child Pages Loop
  5.  
  6. */
  7.  
  8.     // calling the header.php
  9.     get_header();
  10.  
  11.     // action hook for placing content above #container
  12.     thematic_abovecontainer();
  13.  
  14. ?>
  15.  
  16.         <div id="container">
  17.        
  18.             <?php thematic_abovecontent(); ?>
  19.        
  20.             <div id="content">
  21.    
  22.                 <?php
  23.            
  24.                 // calling the widget area 'page-top'
  25.                 get_sidebar('page-top');
  26.    
  27.                 the_post();
  28.                
  29.                 thematic_abovepost();
  30.            
  31.                 ?>
  32.                
  33.                 <div id="post-<?php the_ID(); ?>" class="<?php thematic_post_class() ?>">
  34.                
  35.                     <?php
  36.                    
  37.                     // creating the post header
  38.                     thematic_postheader();
  39.                    
  40.                     ?>
  41.                    
  42.                     <div class="entry-content">
  43.    
  44.                         <?php
  45.                        
  46.                         the_content();
  47.                        
  48.                         wp_link_pages("\t\t\t\t\t<div class='page-link'>".__('Pages: ', 'ip4all'), "</div>\n", 'number');
  49.                        
  50.                         edit_post_link(__('Edit'),'<span class="edit-link">','</span>') ?>
  51.    
  52.                     </div>
  53.                 </div><!-- .post -->
  54.    
  55.             <?php thematic_belowpost(); ?>
  56.            
  57.             <?php // separate loop for listing child-pages
  58.             $child_pages = new WP_Query();
  59.             $child_pages->query(array(
  60.                 'orderby' => 'title',
  61.                 'order' => 'ASC',
  62.                 'posts_per_page' => -1,
  63.                 'post_type' => 'page',
  64.                 'post_parent' => $post->ID
  65.                 ));
  66.            
  67.             if ($child_pages->have_posts()) : while ($child_pages->have_posts()) : $child_pages->the_post(); ?>
  68.  
  69.                 <div id="post-<?php the_ID(); ?>" class="<?php thematic_post_class(); ?>">
  70.                
  71.                     <?php ip4all_post_image(); ?>
  72.                    
  73.                     <h2 class="nomargin">
  74.                         <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
  75.                     </h2>
  76.                    
  77.                     <?php if (has_excerpt()) { ?>
  78.                         <p class="excerpt"><?php $excerpt = strip_tags(get_the_excerpt()); echo $excerpt; ?></p>
  79.                     <?php } ?>
  80.                    
  81.                     <?php edit_post_link(__('Edit', 'ip4all'), '<p class="edit clear">', '</p>'); ?>
  82.                    
  83.                 </div><!-- /.post -->
  84.            
  85.             <?php endwhile; endif; ?>
  86.            
  87.             <?php
  88.             if ( get_post_custom_values('comments') )
  89.                 thematic_comments_template(); // Add a key/value of "comments" to enable comments on pages!
  90.            
  91.             // calling the widget area 'page-bottom'
  92.             get_sidebar('page-bottom');
  93.            
  94.             ?>
  95.    
  96.             </div><!-- #content -->
  97.            
  98.             <?php thematic_belowcontent(); ?>
  99.            
  100.         </div><!-- #container -->
  101.  
  102. <?php
  103.  
  104.     // action hook for placing content below #container
  105.     thematic_belowcontainer();
  106.  
  107.     // calling the standard sidebar
  108.     thematic_sidebar();
  109.    
  110.     // calling footer.php
  111.     get_footer();
  112.  
  113. ?>
Advertisement
Add Comment
Please, Sign In to add comment