/
index.php
executable file
·91 lines (83 loc) · 2.47 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
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
<?php
/*
@package WordPress
@subpackage wp-bootstrap
@author jubianchi <contact@jubianchi.fr>
@version 0.1
*/
?>
<?php get_header(); ?>
<?php global $theme_config; ?>
<?php if($theme_config['sticky_enabled'] && (is_home() || is_front_page())) : ?>
<section class="row">
<?php
$args = array(
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => $theme_config['sticky_formats'],
'operator' => 'IN'
)
),
'showposts' => 3 * $theme_config['sticky_rows']
);
$query = new WP_Query($args);
?>
<?php if( $query -> have_posts() ) : ?>
<?php while ( $query -> have_posts() ) : $query -> the_post(); ?>
<?php get_template_part('content', 'aside'); ?>
<?php endwhile; ?>
<?php endif; ?>
<?php
$args = array(
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => $theme_config['sticky_formats'],
'operator' => 'NOT IN'
)
)
);
query_posts(array_merge($wp_query -> query, $args));
?>
</section>
<?php endif; ?>
<section class="row">
<?php if (is_author() || is_search() || is_date()) : ?>
<header class="span16">
<?php $section = bootstrap_section_heading(); ?>
<?php if (is_author()) : ?>
<hgroup>
<h1 class="section-title"><?php echo $section['section_title']; ?></h1>
</hgroup>
<?php else : ?>
<hgroup>
<h1 class="section-title"><?php echo $section['section_title']; ?> <small><?php echo $section['section_description']; ?></small></h1>
</hgroup>
<?php endif; ?>
</header>
<?php endif; ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php if(is_singular()) : ?>
<?php switch(get_post_format()) {
case 'gallery':
get_template_part('content', get_post_format());
break;
default:
get_template_part('content');
break;
} ?>
<?php else : ?>
<?php get_template_part('content'); ?>
<?php endif; ?>
<?php endwhile; ?>
<?php bootstrap_content_nav( 'nav-below', 'menu' ); ?>
</section>
<?php if(is_singular()) : ?>
<section>
<?php comments_template(); ?>
</section>
<?php endif; ?>
<?php get_footer(); ?>