-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
96 lines (85 loc) · 3.15 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
92
93
94
95
96
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* For example, it puts together the home page when no home.php file exists.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package Kvarteret.no
* @subpackage Kvarteret.no v2
* @since Kvarteret.no v2.0
*/
get_header(); ?>
<section id="frontpage_articles" class="standard_wrapper content_container clearfix grid_fix">
<?php if ( have_posts() ) : ?>
<?php
global $post;
$featuredArray = array_merge(
get_posts('numberposts=3&category_name=featured'),
get_posts('numberposts=3&dak_event_category=featured')
);
$featured = get_posts('numberposts=3&category_name=featured'); // featured news
$current_news = get_posts('numberposts=12&category_name=aktuelt,featured'); // all frontpage news
?>
<h1 class="hidden">Nyheter</h1>
<section id="featured_articles" class="sixteen no-padding columns featured_articles carousel slide">
<div class="carousel-inner">
<?php
// start featured news loop
$featuredi = 0;
foreach($featuredArray as $post) :
setup_postdata($post);
$featuredi++
?>
<article class="item <?php if($featuredi == 1) { echo 'active'; } ?>">
<a href="<?php the_permalink(); ?>" class="clearfix">
<!-- <img src="http://placekitten.com/960/496" class="article_thumbnail responsive" alt="" /> -->
<?php the_post_thumbnail('full-thumbnail', array('class' => 'article_thumbnail responsive')); ?>
<h2><?php the_title(); ?></h2>
</a>
</article>
<?php endforeach; ?>
</div>
<a class="carousel-control left" href="#featured_articles" data-slide="prev">‹</a>
<a class="carousel-control right" href="#featured_articles" data-slide="next">›</a>
</section>
<section class="articles no_padding no_margin">
<?php
// start news loop
foreach($current_news as $post) :
setup_postdata($post);
?>
<article class="one-third column">
<a href="<?php the_permalink(); ?>">
<?php
if(has_post_thumbnail()) {
the_post_thumbnail('one-third-thumbnail', array('class' => 'article_thumbnail responsive'));
} else {
echo '<img src="' . get_bloginfo('template_directory') . '/images/missing_image_296x153.png" alt="" clasS="article_thumbnail responsive" />';
}
?>
<h2><?php the_title(); ?></h2>
</a>
<p><?php the_excerpt(); ?></p>
</article>
<?php endforeach; ?>
<div style="clear:both" class="text-center standard-padding">
<?php
global $wp_query;
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages
) );
?>
</div>
</section>
<?php endif; ?>
</section>
<?php get_footer(); ?>