Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * This template is used to display child page content
- *
- * @package Child of Baskerville 2
- */
- ?>
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <?php
- /**
- * Post Title
- */
- echo '<span class="child-title">';
- the_title( $before_title, $after_title );
- echo '</span>';
- /**
- * Post Thumbnail
- */
- if ( baskerville_2_has_post_thumbnail() ) { ?>
- <div class="featured-media">
- <?php if ( ! is_single() ) { ?>
- <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
- <?php }
- the_post_thumbnail( 'baskerville-2-post-image' );
- if ( ! is_single() ) { ?>
- </a>
- <?php } ?>
- </div> <!-- /featured-media -->
- <?php }
- /**
- * Child Page Excerpts
- */
- $args = array(
- 'post_type' => 'page',
- 'post_parent' => get_the_ID()
- );
- // get child pages
- $query = new WP_Query( $args );
- if ( $query->have_posts() ) {
- echo '<div class="posts-masonry">';
- // loop through the query results
- while ( $query->have_posts() ) {
- $query->the_post();
- echo '<div class="page-container">';
- /**
- * Page Title and Category Link
- */
- $before_title = '<header class="post-header"><h1 class="post-title entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">';
- $cat = get_the_category()[0];
- $link = get_category_link( $cat->term_id );
- $cat_link = "<div class=\"category {$cat->slug}\"><a href=\"$link\">{$cat->name}</a></div>\n";
- $after_title = "</a></h1>$cat_link</header>";
- the_title( $before_title, $after_title );
- /**
- * Post Thumbnail
- */
- if ( baskerville_2_has_post_thumbnail() ) { ?>
- <div class="featured-media">
- <?php if ( ! is_single() ) { ?>
- <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
- <?php }
- the_post_thumbnail( 'baskerville-2-post-image' );
- if ( ! is_single() ) { ?>
- </a>
- <?php } ?>
- </div> <!-- /featured-media -->
- <?php }
- /**
- * Page Excerpt
- */ ?>
- <div class="post-content clear">
- <?php
- echo get_more_excerpt();
- ?>
- </div><!--/.post-content-->
- <div class="clear"></div>
- <?php
- echo '</div><!-- /.page-container -->';
- }
- echo '</div><!-- .posts-masonry -->';
- }
- // Restore original post data.
- wp_reset_postdata();
- //remove_filter( 'the_content', 'get_more_excerpt', 0 );
- wp_link_pages();
- /**
- * Post Meta
- */
- if ( is_single() ) { ?>
- <footer class="post-meta-container clear">
- <?php baskerville_2_author_bio(); ?>
- <div class="post-meta clear">
- <?php baskerville_2_single_post_meta(); ?>
- <?php the_post_navigation(); ?>
- <?php edit_post_link(
- sprintf(
- /* translators: %1$s: Pencil icon, %2$s: Name of current post */
- esc_html__( '%1$s Edit %2$s', 'baskerville-2' ),
- '<i class="fa fa-pencil-square-o"></i>',
- the_title( '<span class="screen-reader-text">"', '"</span>', false )
- ),
- '<span class="edit-link">',
- '</span>'
- ); ?>
- </div>
- </footer> <!-- /post-meta-container -->
- <?php comments_template( '', true );
- } else {
- baskerville_2_post_meta();
- } ?>
- </article> <!-- /post-## -->
Add Comment
Please, Sign In to add comment