-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.php
executable file
·66 lines (60 loc) · 2.55 KB
/
index.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
66
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php get_template_part('head'); ?>
</head>
<?php
$num_posts = 10;
$divided = false;
?>
<body>
<?php get_header(); ?>
<div id="container">
<div id="page">
<div id="previews">
<?php if(have_posts()) : ?>
<div class="column left">
<?php $counter = 0; ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post-preview">
<?php the_post_thumbnail('single-post-thumbnail'); ?>
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<span class="metadata">
<span class="date"><?php the_time('M d, Y'); ?></span>
<span class="author"><?php _e('By '); the_author_posts_link(); edit_post_link('Edit', ' | ', ''); ?></span>
</span>
<p><?php echo get_the_excerpt(); ?> </p>
<div class="more"><a href="<?php the_permalink(); ?>">Read full article</a></div>
</div>
<?php $counter++; ?>
<?php if(($counter > ($num_posts / 2) - 1) && ($divided == false)) : ?>
<?php $counter = 0; $divided = true; ?>
<div class="clearbox"></div>
</div><div class="column right">
<?php endif; ?>
<?php if(($counter == 2) && ($divided == false)) : ?>
<?php get_template_part('ads_c_blog_1.php'); ?>
<?php elseif(($counter == 2) && ($divided == true)) : ?>
<?php get_template_part('ads_c_blog_2.php'); ?>
<?php endif; ?>
<?php endwhile; ?>
</div>
<div class="clearbox"></div>
<div id="navigation">
<p><?php posts_nav_link(); ?></p>
</div>
<?php else : ?>
<div class="post">
<div class="post-head">
<h2>We have no news for the moment. Please come back later</h2>
</div>
</div>
<?php endif; ?>
<div class="push"></div>
</div>
</div>
</div>
<?php get_footer(); ?>
</body>
</html>