Created
May 10, 2018 03:45
-
-
Save generatepress/ebe343298b30bbec84947b940c7526f0 to your computer and use it in GitHub Desktop.
Custom template file to achieve this layout: https://generatepress.com/forums/topic/cpt-single-layout/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The template for displaying posts within the loop. | |
* | |
* @package GeneratePress | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly. | |
} | |
?> | |
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_article_schema( 'CreativeWork' ); ?>> | |
<div class="inside-article"> | |
<div class="grid-30"> | |
<?php | |
/** | |
* generate_before_content hook. | |
* | |
* @since 0.1 | |
* | |
* @hooked generate_featured_page_header_inside_single - 10 | |
*/ | |
do_action( 'generate_before_content' ); | |
/** | |
* generate_after_entry_title hook. | |
* | |
* @since 0.1 | |
* | |
* @hooked generate_post_meta - 10 | |
*/ | |
do_action( 'generate_after_entry_title' ); | |
?> | |
</div> | |
<div class="grid-70"> | |
<header class="entry-header"> | |
<?php | |
/** | |
* generate_before_entry_title hook. | |
* | |
* @since 0.1 | |
*/ | |
do_action( 'generate_before_entry_title' ); | |
the_title( sprintf( '<h2 class="entry-title" itemprop="headline"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); | |
?> | |
</header><!-- .entry-header --> | |
<?php | |
/** | |
* generate_after_entry_header hook. | |
* | |
* @since 0.1 | |
* | |
* @hooked generate_post_image - 10 | |
*/ | |
do_action( 'generate_after_entry_header' ); | |
if ( generate_show_excerpt() ) : ?> | |
<div class="entry-summary" itemprop="text"> | |
<?php the_excerpt(); ?> | |
</div><!-- .entry-summary --> | |
<?php else : ?> | |
<div class="entry-content" itemprop="text"> | |
<?php | |
the_content(); | |
wp_link_pages( array( | |
'before' => '<div class="page-links">' . __( 'Pages:', 'generatepress' ), | |
'after' => '</div>', | |
) ); | |
?> | |
</div><!-- .entry-content --> | |
<?php endif; | |
/** | |
* generate_after_entry_content hook. | |
* | |
* @since 0.1 | |
* | |
* @hooked generate_footer_meta - 10 | |
*/ | |
do_action( 'generate_after_entry_content' ); | |
/** | |
* generate_after_content hook. | |
* | |
* @since 0.1 | |
*/ | |
do_action( 'generate_after_content' ); | |
?> | |
</div> | |
</div><!-- .inside-article --> | |
</article><!-- #post-## --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment