Created
March 16, 2019 16:49
-
-
Save generatepress/4e033b8e30efce6cffc07fe34cb2ac58 to your computer and use it in GitHub Desktop.
Example of attachment.php
This file contains 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 all single posts. | |
* | |
* @package GeneratePress | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly. | |
} | |
get_header(); ?> | |
<div id="primary" <?php generate_do_element_classes( 'content' ); ?>> | |
<main id="main" <?php generate_do_element_classes( 'main' ); ?>> | |
<?php | |
/** | |
* generate_before_main_content hook. | |
* | |
* @since 0.1 | |
*/ | |
do_action( 'generate_before_main_content' ); | |
while ( have_posts() ) : the_post(); | |
?> | |
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_do_microdata( 'article' ); ?>> | |
<div class="inside-article"> | |
<?php | |
/** | |
* generate_before_content hook. | |
* | |
* @since 0.1 | |
* | |
* @hooked generate_featured_page_header_inside_single - 10 | |
*/ | |
do_action( 'generate_before_content' ); | |
?> | |
<header class="entry-header"> | |
<?php | |
/** | |
* generate_before_entry_title hook. | |
* | |
* @since 0.1 | |
*/ | |
do_action( 'generate_before_entry_title' ); | |
if ( generate_show_title() ) { | |
the_title( '<h1 class="entry-title" itemprop="headline">', '</h1>' ); | |
} | |
/** | |
* generate_after_entry_title hook. | |
* | |
* @since 0.1 | |
* | |
* @hooked generate_post_meta - 10 | |
*/ | |
do_action( 'generate_after_entry_title' ); | |
?> | |
</header><!-- .entry-header --> | |
<?php | |
/** | |
* generate_after_entry_header hook. | |
* | |
* @since 0.1 | |
* | |
* @hooked generate_post_image - 10 | |
*/ | |
do_action( 'generate_after_entry_header' ); | |
?> | |
<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 | |
/** | |
* 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><!-- .inside-article --> | |
</article><!-- #post-## --> | |
<?php | |
// If comments are open or we have at least one comment, load up the comment template. | |
if ( comments_open() || '0' != get_comments_number() ) : | |
/** | |
* generate_before_comments_container hook. | |
* | |
* @since 2.1 | |
*/ | |
do_action( 'generate_before_comments_container' ); | |
?> | |
<div class="comments-area"> | |
<?php comments_template(); ?> | |
</div> | |
<?php | |
endif; | |
endwhile; | |
/** | |
* generate_after_main_content hook. | |
* | |
* @since 0.1 | |
*/ | |
do_action( 'generate_after_main_content' ); | |
?> | |
</main><!-- #main --> | |
</div><!-- #primary --> | |
<?php | |
/** | |
* generate_after_primary_content_area hook. | |
* | |
* @since 2.0 | |
*/ | |
do_action( 'generate_after_primary_content_area' ); | |
generate_construct_sidebars(); | |
get_footer(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment