Convert to Gutenberg blocks
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* Universal page template: renders the editor content.
|
||||
* Universal page template: renders the editor content full-width
|
||||
* so block patterns control their own sections and backgrounds.
|
||||
*
|
||||
* Page hero is shown if the page has a title and there is no [hero] shortcode
|
||||
* already in the content. Any [hero] shortcode placed at the top of the editor
|
||||
* replaces this automatic hero.
|
||||
* An automatic page hero (title + excerpt) is shown only when the content
|
||||
* does not already include a hero ([hero] shortcode or a block pattern with
|
||||
* the hl-hero / hl-page-hero class).
|
||||
*/
|
||||
get_header();
|
||||
?>
|
||||
@@ -15,31 +16,29 @@ get_header();
|
||||
the_post();
|
||||
|
||||
$content = get_the_content();
|
||||
if ( false !== strpos( $content, '[hero' ) ) {
|
||||
// Hero handled inside the content via shortcode.
|
||||
} else {
|
||||
|
||||
$has_hero_pattern = ( false !== strpos( $content, 'hl-hero' ) )
|
||||
|| ( false !== strpos( $content, 'hl-page-hero' ) );
|
||||
|
||||
if ( ! has_shortcode( $content, 'hero' ) && ! $has_hero_pattern ) {
|
||||
?>
|
||||
<section class="page-hero">
|
||||
<div class="container">
|
||||
<h1><?php the_title(); ?></h1>
|
||||
<section class="hl-page-hero">
|
||||
<div class="hl-container">
|
||||
<h1 class="hl-page-hero__title"><?php the_title(); ?></h1>
|
||||
<?php if ( has_excerpt() ) : ?>
|
||||
<p><?php echo esc_html( get_the_excerpt() ); ?></p>
|
||||
<p class="hl-page-hero__subtitle"><?php echo esc_html( get_the_excerpt() ); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="entry-content">
|
||||
<?php the_content(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<?php endwhile; ?>
|
||||
echo '<div class="entry-content">';
|
||||
the_content();
|
||||
echo '</div>';
|
||||
endwhile;
|
||||
?>
|
||||
</main>
|
||||
|
||||
<?php
|
||||
get_footer();
|
||||
get_footer();
|
||||
Reference in New Issue
Block a user