Commit 66d004ad authored by Jakob Moser's avatar Jakob Moser
Browse files

Hide default header image in index articles

parent 72a440d2
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
<article>
    <header style="background-image:url('<?php if(has_post_thumbnail()) {
    <?php if(has_post_thumbnail()) {
        // A header configured specifically for this article
            the_post_thumbnail_url();
        } else {
        $url = get_the_post_thumbnail_url();
    } elseif(!$args["hide_default_header_image"]) {
        // Fall back to the default header (which can be configured site-wide, so we can't hardcode the URL)
            header_image();
        } ?>')">
        $url = get_header_image();
    } else {
        $url = null;
    }

    if($url !== null) {
        $style = "style=\"background-image:url('$url')\"";
    } else {
        $style = "";
    } ?>

    <header <?php echo $style; ?>>
        <?php if($args["link_title"]): ?>
            <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
        <?php else: ?>
+2 −1
Original line number Diff line number Diff line
@@ -53,7 +53,8 @@ get_header();
            "show_published_date" => true,
            "show_modified_date" => false,
            "show_only_excerpt" => true,
            "link_title" => true
            "link_title" => true,
            "hide_default_header_image" => true
        ));
    } ?>