-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate-home.php
45 lines (39 loc) · 1.38 KB
/
template-home.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
<?
/*
Name: Home
URI: http://tcms.me/
*/
/**
display: admin
secondary-title: text:Secondary Title
blocks:
instagram: text:Instagram URL
*/
theme::part('partials/header', array( 'title'=>'Home'));
theme::part('partials/hero') ?>
<div class="container m-top-60 instagram">
<div class="row mt centered">
<?
$blocks = array_reverse($post_meta->collection['blocks']);
foreach ($blocks as $collection ):
if ($collection['instagram'] != ''):
$url = $collection['instagram']; ?>
<div class="col-md-4 col-sm-6">
<?
$o_image = oembed_content($url, true); ?>
<a href="<?=$url?>" target="_blank">
<? if(!isset($o_image->thumbnail_url)) { ?>
<img src="<?= get_instagram_photo(file_get_contents($url)) ?>" alt="<?= $o_image->title ?>" class="m-bottom-15"/>
<? } else { ?>
<img src="<?= $o_image->thumbnail_url ?>" alt="<?= $o_image->title ?>" class="m-bottom-15"/>
<? } ?>
</a>
<p>
<?= $o_image->title ?>
</p>
</div>
<? endif;
endforeach; ?>
</div>
</div>
<? theme::part('partials/footer') ?>