-
Notifications
You must be signed in to change notification settings - Fork 0
/
loop.php
64 lines (45 loc) · 1.6 KB
/
loop.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php if (have_posts()) :
while (have_posts()) : the_post() ?>
<article role="article" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header>
<?php if ( get_post_meta( get_the_ID(), 'pp-ettan-site-name', true ) ) : ?>
<div class="ettan-site-name">
<a href="<?php echo esc_attr( get_post_meta( get_the_ID(), 'pp-ettan-site-url', true ) ) ?>">
<?php echo esc_html( get_post_meta( get_the_ID(), 'pp-ettan-site-name', true ) ) ?>
</a>
</div>
<?php endif ?>
<h1 class="entry-title">
<?php if (!is_single() && !is_page()) : ?>
<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>
<?php else : ?>
<?php the_title() ?>
<?php endif; ?>
</h1>
<?php get_template_part( 'entry', 'header' ); ?>
</header>
<div class="entry-content">
<?php if ( has_post_thumbnail() ) : ?>
<figure class="alignleft">
<?php the_post_thumbnail('thumbnail') ?>
</figure>
<?php endif ?>
<?php if ( is_single() || is_page() ) : ?>
<?php the_content(); ?>
<?php else : ?>
<?php the_excerpt(); ?>
<?php endif ?>
</div>
<footer>
<?php get_template_part( 'entry', 'footer' ) ?>
</footer>
<?php get_template_part( 'entry', 'comments' ) ?>
</article>
<?php endwhile; ?>
<?php get_template_part( 'pager' ) ?>
<?php elseif (is_search()) : ?>
<article>
<h1>Din sökning gav inget resultat</h1>
<p>Din sökning på <em><?php echo filter_var($_GET['s'], FILTER_SANITIZE_STRING) ?></em> gav tyvärr inget resultat.</p>
</article>
<?php endif; ?>