-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfront-page.php
More file actions
193 lines (153 loc) · 5.76 KB
/
front-page.php
File metadata and controls
193 lines (153 loc) · 5.76 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<?php
// Exit if accessed directly
if ( !defined('ABSPATH')) exit;
/**
* Front Page
*
*
* @file front-page.php
* @package AI
* @author Emil Uzelac, Ulrich Pogson
* @copyright 2003 - 2012 ThemeID
* @license license.txt
* @version Release: 2.0
* @filesource wp-content/themes/ai/front-page.php
* @link http://codex.wordpress.org/Template_Hierarchy
* @since available since Release 2.0
*/
/**
* Globalize Theme Options
*/
$responsive_options = responsive_get_options();
/**
* If front page is set to display the
* blog posts index, include home.php;
* otherwise, display static front page
* content
*/
if ( 'posts' == get_option( 'show_on_front' ) && $responsive_options['front_page'] != 1 ) {
get_template_part( 'home' );
} elseif ( 'page' == get_option( 'show_on_front' ) && $responsive_options['front_page'] != 1 ) {
$template = get_post_meta( get_option( 'page_on_front' ), '_wp_page_template', true );
$template = ( $template == 'default' ) ? 'index.php' : $template;
locate_template( $template, true );
} else {
get_header();
//test for first install no database
$db = get_option( 'responsive_theme_options' );
//test if all options are empty so we can display default text if they are
$empty = ( empty( $responsive_options['home_headline'] ) && empty( $responsive_options['home_subheadline'] ) && empty( $responsive_options['home_content_area'] ) ) ? false : true;
?>
<div id="featured" class="grid col-940">
<h1 class="featured-title">
<?php
if ( isset( $responsive_options['home_headline'] ) && $db && $empty )
echo $responsive_options['home_headline'];
else
_e( 'Hello, World!', 'responsive' );
?>
</h1>
<p>
<?php
if ( isset( $responsive_options['home_content_area'] ) && $db && $empty )
echo do_shortcode( $responsive_options['home_content_area'] );
else
_e( 'Your title, subtitle and this very content is editable from Theme Option. Call to Action button and its destination link as well. Image on your right can be an image or even YouTube video if you like.','responsive' );
?>
</p>
<?php if ( empty( $responsive_options['cta_button'] ) ) : ?>
<div class="call-to-action">
<a href="<?php echo $responsive_options['cta_url']; ?>" class="blue button">
<?php
if( isset( $responsive_options['cta_text'] ) && $db && $empty )
echo $responsive_options['cta_text'];
else
_e('Call to Action','responsive');
?>
</a>
</div><!-- end of .call-to-action -->
<?php endif; ?>
</div><!-- end of #featured -->
<div id="featured-middle" class="grid col-940">
<div id="featured-image-title" class="grid col-460">
<h2 class="featured-subtitle">
<?php
if ( isset( $responsive_options['home_subheadline'] ) && $db && $empty )
echo $responsive_options['home_subheadline'];
else
_e( 'Your H2 subheadline here', 'responsive' );
?>
</h2>
</div><!-- end of #featured-image-title -->
<div id="featured-image" class="grid col-460 fit">
<?php
$featured_content = ( !empty( $responsive_options['featured_content'] ) ) ? $responsive_options['featured_content'] :
'<iframe src="http://fast.wistia.com/embed/iframe/fh3u926d9i?controlsVisibleOnLoad=true&version=v1&videoHeight=248&videoWidth=440&volumeControl=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" width="440" height="248"></iframe>';
echo do_shortcode( $featured_content );
?>
</div><!-- end of #featured-image -->
</div><!-- end of #feaured-middle -->
<div id="content-news" class="clearfix">
<div class="grid col-620">
<?php
global $wp_query, $paged;
if( get_query_var( 'paged' ) ) {
$paged = get_query_var( 'paged' );
}
elseif( get_query_var( 'page' ) ) {
$paged = get_query_var( 'page' );
}
else {
$paged = 1;
}
$blog_query = new WP_Query( array(
// category name
'category_name' => 'featured',
// number of posts
'posts_per_page' => 3,
'post_type' => 'post',
'paged' => $paged
) );
$temp_query = $wp_query;
$wp_query = null;
$wp_query = $blog_query;
if ( $blog_query->have_posts() ) :
while ( $blog_query->have_posts() ) : $blog_query->the_post();
?>
<?php responsive_entry_before(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php responsive_entry_top(); ?>
<?php get_template_part( 'post-meta' ); ?>
<div class="post-entry">
<?php if ( has_post_thumbnail()) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
<?php the_post_thumbnail(); ?>
</a>
<?php endif; ?>
<?php the_content(__('Read more ›', 'responsive')); ?>
<?php wp_link_pages(array('before' => '<div class="pagination">' . __('Pages:', 'responsive'), 'after' => '</div>')); ?>
</div><!-- end of .post-entry -->
<?php get_template_part( 'post-data' ); ?>
<?php responsive_entry_bottom(); ?>
</div><!-- end of #post-<?php the_ID(); ?> -->
<?php responsive_entry_after(); ?>
<?php
endwhile;
if ( $wp_query->max_num_pages > 1 ) :
?>
<div class="navigation">
<div class="previous"><?php next_posts_link( __( '‹ Older posts', 'responsive' ), $wp_query->max_num_pages ); ?></div>
<div class="next"><?php previous_posts_link( __( 'Newer posts ›', 'responsive' ), $wp_query->max_num_pages ); ?></div>
</div><!-- end of .navigation -->
<?php
endif;
else :
get_template_part( 'loop-no-posts' );
endif;
$wp_query = $temp_query;
wp_reset_postdata();
?>
</div><!-- end of .grid col-620-->
<?php get_sidebar('home'); ?>
</div><!-- end of #content-news -->
<?php get_footer(); } ?>