Skip to content

Commit 2852088

Browse files
committed
Do not show featured image on pages if option is set
1 parent 6f89447 commit 2852088

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sass/_single.scss

-5
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@
4242
margin: 0;
4343
}
4444

45-
46-
header.has-no-post-thumbnail {
47-
margin-bottom: 0;
48-
}
49-
5045
body.page .entry-header {
5146
padding-bottom: 35px;
5247
}

template-parts/content-page.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @package sunflower
88
*/
99

10+
$sunflower_show_post_thumbnail = has_post_thumbnail() && ! get_post_meta( $post->ID, '_sunflower_hide_feature_image', true );
1011
$sunflower_styled_layout = (bool) get_post_meta( $post->ID, '_sunflower_styled_layout', true ) ?? false;
1112
$sunflower_class = $args['class'] ?? '';
1213
?>
@@ -20,7 +21,11 @@
2021
}
2122
?>
2223

23-
<?php sunflower_post_thumbnail( $sunflower_styled_layout, true ); ?>
24+
<?php
25+
if ( $sunflower_show_post_thumbnail ) {
26+
sunflower_post_thumbnail( $sunflower_styled_layout, true );
27+
}
28+
?>
2429

2530
<div class="entry-content accordion">
2631
<?php

0 commit comments

Comments
 (0)