Commit 72a440d2 authored by Jakob Moser's avatar Jakob Moser
Browse files

Use article component in index

parent 5cb4c8c6
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -6,10 +6,19 @@
            // Fall back to the default header (which can be configured site-wide, so we can't hardcode the URL)
            header_image();
        } ?>')">

        <?php if($args["link_title"]): ?>
            <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
        <?php else: ?>
            <h1><?php the_title(); ?></h1>
        <?php endif; ?>
    </header>
    <div class="content">
        <?php the_content(); ?>
        <?php if($args["show_only_excerpt"]) {
            the_excerpt();
        } else {
            the_content(); 
        } ?>
    </div>
    <footer>
        <?php if($args["show_author"]): ?>
@@ -17,7 +26,7 @@
        <?php endif; ?>

        <?php if($args["show_published_date"]): ?>
            <div class="published date">Veröffentlicht: <time><?php the_date(); ?></time></div>
            <div class="published date"><span class="label">Veröffentlicht: </span><time><?php the_date(); ?></time></div>
        <?php endif; ?>

        <?php if($args["show_modified_date"]):
@@ -26,7 +35,7 @@
                $different = "different";
            }
        ?>
            <div class="modified date <?php echo $different; ?>">Zuletzt geändert: <time><?php the_modified_date(); ?></time></div>
            <div class="modified date <?php echo $different; ?>"><span class="label">Zuletzt geändert: </span><time><?php the_modified_date(); ?></time></div>
        <?php endif; ?>
    </footer>
</article>
+10 −19
Original line number Diff line number Diff line
@@ -46,25 +46,16 @@ get_header();
</aside>

<main class="list">
    <?php while ( have_posts() ) : the_post(); ?>
        <article>
            <header
                <?php if ( has_post_thumbnail($post->ID) ) : ?>
                style="background-image:url('<?php echo wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>');"
                <?php endif; ?>
            >
                <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
            </header>

            <div class="content">
                <?php the_excerpt(); ?>
            </div>

            <footer>
                <div class="published date"><time><?php the_date(); ?></time></div>
            </footer>
        </article>
    <?php endwhile; ?>
    <?php while (have_posts()) {
        the_post();
        get_template_part("components/article", null, array(
            "show_author" => false,
            "show_published_date" => true,
            "show_modified_date" => false,
            "show_only_excerpt" => true,
            "link_title" => true
        ));
    } ?>

    <div class="pagination">
        <div class="older-posts"><?php next_posts_link( '« Ältere Posts' ); ?></div>
+4 −0
Original line number Diff line number Diff line
@@ -614,6 +614,10 @@ main.list footer .date {
    opacity: 0.5;
}

main.list footer .date .label {
    display: none;
}

main.list article .content {
    position: relative;
    z-index: 1;