Advertisement
Guest User

Untitled

a guest
Aug 19th, 2011
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.44 KB | None | 0 0
  1. <?php
  2. /**
  3.  * This file lists the child pages of the page currently being displayed,
  4.  * if it has any.
  5. */
  6. global $post, $graphene_settings;
  7.  
  8. if ( $graphene_settings['child_page_listing'] == 'show_always' ||
  9.      ( $graphene_settings['child_page_listing'] == 'show_if_parent_empty' && $post->post_content == '' )) :
  10.  
  11.    
  12.    
  13.     /* Get the child pages */
  14.     $args = array(
  15.         'post_parent' => $post->ID,
  16.         'orderby' => 'menu_order, title',
  17.         'order' => 'ASC',
  18.         'post_type' => 'page',
  19.     );
  20.     $pages = new WP_Query( apply_filters('graphene_child_pages_args', $args ) );
  21.  
  22.     if ( $pages->have_posts() ) :
  23.     ?>
  24.     <div class="child-pages-wrap">
  25.         <?php while ( $pages->have_posts() ) : $pages->the_post(); ?>
  26.         <div class="post child-page page" id="page-<?php the_ID(); ?>">
  27.             <div class="entry">
  28.                     <div class="entry-content clearfix">
  29.                     <?php /* The post thumbnail */
  30.                     if ( has_post_thumbnail( get_the_ID() ) ) {
  31.                         echo '<div class="excerpt-thumb"><a href="' . get_permalink( get_the_ID() ) . '">';
  32.                         echo get_the_post_thumbnail( get_the_ID(), apply_filters( 'graphene_excerpt_thumbnail_size', 'thumbnail' ) );
  33.                         echo '</a></div>';
  34.                     } else {
  35.                         echo graphene_get_post_image( get_the_ID(), apply_filters( 'graphene_excerpt_thumbnail_size', 'thumbnail' ), 'excerpt' );  
  36.                     }
  37.                     ?>
  38.  
  39.                     <?php /* The title */ ?>
  40.                     <h2 class="post-title">
  41.                         <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php printf( esc_attr__( 'Permalink to %s', 'graphene' ), get_the_title() ); ?>"><?php if ( get_the_title() == '' ) { _e( '(No title)','graphene' ); } else { the_title(); } ?></a>
  42.                     </h2>
  43.  
  44.                     <?php /* The excerpt */
  45.                     the_excerpt();
  46.                     ?>
  47.  
  48.                     <?php /* View page link */ ?>
  49.                     <p><a href="<?php the_permalink(); ?>" class="block-button" rel="bookmark" title="<?php printf( esc_attr__( 'Permalink to %s', 'graphene' ), get_the_title() ); ?>"><?php _e( 'View page &raquo;', 'graphene' ); ?></a></p>
  50.                 </div>
  51.             </div>
  52.         </div>
  53.         <?php endwhile; ?>
  54.     </div>
  55. <?php
  56.         endif; wp_reset_postdata();
  57.     endif;
  58. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement