Browse Source

feat: use featured image when provided (#358)

pull/359/head
Felipe Dalcin 2 years ago committed by GitHub
parent
commit
45f02ccc21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      header.php

17
header.php

@ -45,14 +45,19 @@
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'pressbooks-aldine' ); ?></a>
<header class="header" role="banner" style="background-image: url(
<?php
if ( is_front_page() ) {
if ( has_header_image() ) {
echo( get_header_image() );
if ( has_post_thumbnail() ) {
echo get_the_post_thumbnail_url();
} else {
if ( is_front_page() ) {
if ( has_header_image() ) {
echo( get_header_image() );
} else {
echo get_template_directory_uri() . '/dist/images/header.jpg';
}
} else {
echo get_template_directory_uri() . '/dist/images/header.jpg';
echo get_template_directory_uri() . '/dist/images/catalog-header.jpg';
}
} else {
echo get_template_directory_uri() . '/dist/images/catalog-header.jpg';
}
?>
);">

Loading…
Cancel
Save