-
Notifications
You must be signed in to change notification settings - Fork 1
/
page-homepage.php
116 lines (92 loc) · 3.1 KB
/
page-homepage.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
/*
Template Name: Homepage
*/
?>
<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">
<div class="banner">
<div class="container">
<?php
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
the_post_thumbnail('wpbs-featured-home');
}
else {
echo get_post_meta($post->ID, 'custom_tagline' , true);
}
?>
</div>
</div>
<div class="container">
<div id="content" class="clearfix row">
<div id="main" class="span16 clearfix" role="main">
<section class="row post_content">
<div class="span10">
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
</div>
<?php get_sidebar('sidebar2'); // sidebar 2 ?>
</section> <!-- end article header -->
<footer>
<p class="clearfix"><?php the_tags('<span class="tags">' . __("Tags","bonestheme") . ': ', ', ', '</span>'); ?></p>
</footer> <!-- end article footer -->
</article> <!-- end article -->
<?php
// No comments on homepage
//comments_template();
?>
<?php endwhile; ?>
<?php else : ?>
<article id="post-not-found">
<header>
<h1><?php _e("Not Found", "bonestheme"); ?></h1>
</header>
<section class="post_content">
<p><?php _e("Sorry, but the requested resource was not found on this site.", "bonestheme"); ?></p>
</section>
<footer>
</footer>
</article>
<?php endif; ?>
</div> <!-- end #main -->
</div> <!-- end #content -->
</div> <!-- end #container -->
<section class="blog-latest">
<div class="container">
<?php
if (of_get_option('number_posts')) {
$poststoshow = 'numberposts='.of_get_option('number_posts');
}
else {
$poststoshow = 'numberposts=1';
}
$postslist = get_posts($poststoshow);
foreach ($postslist as $post) :
setup_postdata($post);
?>
<?php
if (wp_get_attachment_url( get_post_thumbnail_id($post->ID) )) {
$imgurl = $imgurl = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
}
else {
$imgurl = get_template_directory_uri().'/images/thumb.png';
}
?>
<div class="row">
<div class="span6 thumb">
<a href="<?php the_permalink(); ?>" style="background-image:url(<?php echo $imgurl ?>)"></a>
</div>
<div class="span10">
<h2><?php the_title(); ?></h2>
<div class="excerpt">
<?php the_excerpt() ?>
</div>
<a class="btn btn-primary btn-large" href="<?php the_permalink(); ?>">More</a>
</div>
</div>
<?php endforeach ?>
</div> <!-- end #container -->
</section>
<?php //get_sidebar(); // sidebar 1 ?>
<?php get_footer(); ?>