Skip to content

Commit 31d8d05

Browse files
committed
Disable header for posts/events without featured image
1 parent ac7dcfd commit 31d8d05

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

themes/osi/template-parts/header-featured-image.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,29 @@
1414

1515
?>
1616

17-
<?php if ( has_post_thumbnail() && 'post' !== get_post_type( $post ) ) : ?>
17+
<?php if ( has_post_thumbnail() && 'post' !== get_post_type( $post ) ) { ?>
1818
<header class="entry-header cover--header">
1919
<div class="wp-block-cover alignfull">
2020
<img class="wp-block-cover__image-background" alt="" src="<?php the_post_thumbnail_url(); ?>" data-object-fit="cover"/>
2121
<div class="wp-block-cover__inner-container">
2222
</div>
2323
</div>
2424
</header>
25-
<?php elseif ( is_page() ) : ?>
25+
<?php } else if ( ! has_post_thumbnail() && ! in_array( get_post_type( $post ), array( 'post', 'event' ), true ) ) { ?>
2626
<header class="entry-header cover--header no-thumbnail">
27-
<div class="wp-block-cover alignfull has-neutral-dark-background-color has-background-dim-100 has-background-dim">
27+
<div class="wp-block-cover alignfull">
2828
<div class="wp-block-cover__inner-container">
29-
<?php echo ( ! empty( $page_title ) ) ? '<h1 class="entry-title page--title">' . esc_html( $page_title ) . '</h1>' : ''; ?>
3029
<?php osi_the_page_dates(); ?>
3130
</div>
3231
</div>
3332
</header>
34-
<?php else : ?>
33+
<?php } elseif ( is_page() ) { ?>
3534
<header class="entry-header cover--header no-thumbnail">
36-
<div class="wp-block-cover alignfull">
35+
<div class="wp-block-cover alignfull has-neutral-dark-background-color has-background-dim-100 has-background-dim">
3736
<div class="wp-block-cover__inner-container">
37+
<?php echo ( ! empty( $page_title ) ) ? '<h1 class="entry-title page--title">' . esc_html( $page_title ) . '</h1>' : ''; ?>
3838
<?php osi_the_page_dates(); ?>
3939
</div>
4040
</div>
4141
</header>
42-
<?php endif; ?>
42+
<?php } ?>

0 commit comments

Comments
 (0)