forked from danpros/occasio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.html.php
65 lines (64 loc) · 3.86 KB
/
main.html.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
65
<?php if (!defined('HTMLY')) die('HTMLy'); ?>
<?php foreach ($posts as $p):?>
<?php $img = get_image($p->body);?>
<article class="tz-magazine-post post type-post status-publish format-standard has-post-thumbnail hentry">
<?php if (!empty($p->image)) {?>
<figure class="post-image">
<a class="wp-post-image-link" href="<?php echo $p->url;?>" rel="bookmark" aria-hidden="true">
<img src="<?php echo $p->image;?>" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="<?php echo $p->title;?>" loading="lazy" width="100%"/>
</a>
</figure>
<?php } elseif (!empty($img) && empty($p->quote) && config('teaser.type') === 'trimmed') { ?>
<figure class="post-image">
<a class="wp-post-image-link" href="<?php echo $p->url;?>" rel="bookmark" aria-hidden="true">
<img src="<?php echo $img;?>" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="<?php echo $p->title;?>" loading="lazy" width="100%"/>
</a>
</figure>
<?php } ?>
<?php if (!empty($p->video)):?>
<figure class="post-image" <?php if (config('teaser.type') === 'full') {?>style="height:315px;"<?php } else {?>style="height:215px;"<?php } ?>>
<iframe width="100%" height="100%" class="embed-responsive-item" src="https://www.youtube.com/embed/<?php echo get_video_id($p->video); ?>" frameborder="0" allowfullscreen></iframe>
</figure>
<?php endif;?>
<?php if (!empty($p->audio)):?>
<figure class="post-image" <?php if (config('teaser.type') === 'full') {?>style="height:215px;"<?php } else {?>style="height:215px;"<?php } ?>>
<iframe width="100%" height="100%" class="embed-responsive-item" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=<?php echo $p->audio;?>&auto_play=false&visual=true"></iframe>
</figure>
<?php endif;?>
<?php if (!empty($p->quote)):?>
<figure class="post-image" style="font-size:20px;">
<blockquote><?php echo $p->quote;?></blockquote>
</figure>
<?php endif;?>
<header class="post-header entry-header">
<?php if(!empty($p->link)){ ?>
<h2 class="post-title entry-title post-link"><a href="<?php echo $p->link;?>" target="_blank"><?php echo $p->title;?></a></h2>
<?php } else { ?>
<h2 class="post-title entry-title"><a href="<?php echo $p->url;?>" rel="bookmark"><?php echo $p->title;?></a></h2>
<?php } ?>
<div class="entry-meta">
<div class="entry-categories"> <?php echo $p->category;?></div>
<span class="posted-on"><a href="<?php echo $p->url;?>" rel="bookmark"><time class="entry-date published"><?php echo format_date($p->date);?></time></a></span>
<?php if (disqus_count()) { ?>
<span><i class="fa fa-comments"></i> <a href="<?php echo $p->url ?>#disqus_thread"> <?php echo i18n('Comments');?></a></span>
<?php } elseif (facebook()) { ?>
<span><i class="fa fa-comments"></i> <a href="<?php echo $p->url ?>#comments"><span><fb:comments-count href=<?php echo $p->url ?>></fb:comments-count> <?php echo i18n('Comments');?></span></a></span>
<?php } ?>
<?php if (login()) { echo ' <span class="edit-post"><a href="'. $p->url .'/edit?destination=post">Edit</a></span>'; } ?>
</div>
</header><!-- .entry-header -->
<div class="entry-content entry-excerpt">
<?php echo get_teaser($p->body, $p->url); ?>
<?php if (config('teaser.type') === 'trimmed'):?><div style="display:block;"><a style="margin-top:1.5em;" class="read-more" href="<?php echo $p->url; ?>"><?php echo config('read.more'); ?> <span class="screen-reader-text"><?php echo $p->title; ?></span></a> </div><?php endif;?>
</div><!-- .entry-content -->
</article>
<?php endforeach;?>
<?php if (!empty($pagination['prev']) || !empty($pagination['next'])): ?>
<nav class="navigation pagination" role="navigation" aria-label="Posts" style="">
<h2 class="screen-reader-text">Posts navigation</h2>
<div class="nav-links"><?php echo $pagination['html'];?></div>
</nav>
<?php endif;?>
<?php if (disqus_count()): ?>
<?php echo disqus_count() ?>
<?php endif; ?>