Created
March 30, 2022 16:49
-
-
Save FriendlyWP/1337828a651ecf7bd1249eb40c6ce0a2 to your computer and use it in GitHub Desktop.
WordPress page template for GeneratePress
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 | |
/** | |
* Template Name: No-Image Header | |
* Template Post Type: post, page | |
* | |
* | |
* @package GeneratePress | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly. | |
} | |
get_header(); ?> | |
<div <?php generate_do_attr( 'content' ); ?>> | |
<main <?php generate_do_attr( 'main' ); ?>> | |
<?php | |
/** | |
* generate_before_main_content hook. | |
* | |
* @since 0.1 | |
*/ | |
do_action( 'generate_before_main_content' ); | |
if ( generate_has_default_loop() ) { | |
while ( have_posts() ) : | |
the_post(); | |
if (get_post_type() === 'page') { | |
generate_do_template_part( 'page' ); | |
} elseif (get_post_type() === 'post') { | |
generate_do_template_part( 'single' ); | |
} | |
endwhile; | |
} | |
/** | |
* generate_after_main_content hook. | |
* | |
* @since 0.1 | |
*/ | |
do_action( 'generate_after_main_content' ); | |
?> | |
</main> | |
</div> | |
<?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