-
Notifications
You must be signed in to change notification settings - Fork 1
/
loop.php
executable file
·84 lines (66 loc) · 2.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
if ( !defined('ABSPATH')) exit;
get_header();
?>
<div class="root container <?php $category = get_the_category();echo $category[0]->slug; ?>">
<div class="BasicCategory">
<?php if (have_posts()) : ?>
<?php $count = 0; ?>
<?php while (have_posts()) : the_post(); ?>
<?php $count++; ?>
<?php if ($count == 1) : ?>
<div style="background: #ccc;">
<?php
/// Getting the Image
if ( has_post_thumbnail() ) {
the_post_thumbnail('large-thumb');
}
else{
echo '<img width="150" height="111" src="' . get_template_directory_uri() . '/images/logo.png">';
}
/// END Getting the image
?>
<h3 class="job-title"><?php the_title(); ?></h3>
<h5 class="LoopPostAuthor"><?php $author = get_the_author(); echo "$author"; echo get_the_date(); ?>
</h5><?php the_excerpt(); ?>
<h6 class="LoopPostInfo"><?php comments_number( 'no comments', '1 comment', '% comments' ); ?> * <?php echo getPostViews(get_the_ID()); ?></h6>
</div>
<?php elseif ($count == 2 || $count == 3) : ?>
<div style="background: #0ff;">
<h3 class="job-title"><?php the_title(); ?></h3>
<h5 class="LoopPostAuthor"><?php $author = get_the_author(); echo "$author"; echo get_the_date(); ?>
</h5><?php the_excerpt(); ?>
<h6 class="LoopPostInfo"><?php comments_number( 'no comments', '1 comment', '% comments' ); ?> * <?php echo getPostViews(get_the_ID()); ?></h6>
</div>
<?php elseif ($count == 4) : ?>
<div style="background: #f00;">
<h3 class="job-title"><?php the_title(); ?></h3>
<h5 class="LoopPostAuthor"><?php $author = get_the_author(); echo "$author"; echo get_the_date(); ?>
</h5><?php the_excerpt(); ?>
</div>
<?php else : ?>
<div style="background: #ccc;">
<?php
/// Getting the Image
if ( has_post_thumbnail() ) {
the_post_thumbnail('large-thumb');
}
else{
echo '<img width="150" height="111" src="' . get_template_directory_uri() . '/images/logo.png">';
}
/// END Getting the image
?>
<h3 class="job-title"><?php the_title(); ?></h3>
<h5 class="LoopPostAuthor"><?php $author = get_the_author(); echo "$author"; echo get_the_date(); ?>
</h5><?php the_excerpt(); ?>
<h6 class="LoopPostInfo"><?php comments_number( 'no comments', '1 comment', '% comments' ); ?> * <?php echo getPostViews(get_the_ID()); ?></h6>
</div>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
<div class="BasicLoop sidebar">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Page Sidebar') ): endif;?>
</div>
</div>
<?php get_footer(); ?>