+ initial commit
[sfa:tema.git] / page_aktuelt.php
1 <?php
2 /**
3  * @package sfa
4  * @subpackage sfa-theme
5  */
6 /*
7 Template Name: Aktuelt
8 */
9
10 get_header();
11
12 ?>
13       <div class="article layoutSidebar emptySidebar">
14         <div class="line">
15           <div class="unit size4of5">
16             <div id="section-main">
17               <!-- center column content goes here -->              
18               <?php if (have_posts()) : while (have_posts()) : the_post(); ?>              
19               <h1><?php the_title(); ?></h1>
20               <?php endwhile; endif; ?>
21               
22               <?php $args = array(
23                                                                   'title_li' => '',
24                                                                   'child_of'=> get_cat_id('Tema'),                                                                
25                                                                   'orderby' => 'id',
26                                                                   'depth' => 1,
27                                                                   'order' => 'ASC',
28                                                                   'hide_empty' => 0
29                                                                   );
30                                 $categories = get_categories($args);
31                           ?>
32               <?php selection_filter($categories); ?>
33                           <?php
34                           //ignore sticky for this page
35                           remove_filter('posts_orderby', 'sticky_orderby',1);
36                                 if( isset($_GET['v']) ) {
37                                         get_query_by_url( $_GET['v'], $categories );
38                                 } else {
39                                         query_posts('posts_per_page=-1&cat=' . get_cat_id('Tema') .",+".get_cat_id('Forside') .',-' . get_cat_id('Temabeskrivelse') . ',-' . get_cat_id('Debattinnlegg'));
40                                 }
41                           ?>
42               
43               <ol class="archive-listing">
44                 <?php if (have_posts()) : while (have_posts()) : the_post(); ?>            
45                 <li>
46                   <h2>
47                     <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
48                   </h2>
49                   <dl class="byline">
50                     <dt class="accessibilityHidden">Dato:</dt>
51                     <dd><?php the_time('j. F Y') ?></dd>
52                     <?php the_category_extended(', ', '<dt>Tema:</dt><dd>', '</dd>'); ?>
53                     <?php if ( is_user_logged_in() ){ ?>            
54                         <dt>Redaksjonelle verkt√ły:</dt>
55                         <dd><?php edit_post_link('Rediger'); ?></dd>
56                     <?php } ?>
57                   </dl>
58                   <div class="shortintro">
59                     <?php the_excerpt(); ?>
60                   </div>
61                   <hr />
62                 </li>  
63          
64                 <?php endwhile; ?>
65               </ol>
66
67
68               
69               <?php else :
70                                 echo '<p>Ingen aktuelle innlegg funnet.</p>';
71                           endif; ?>
72               
73             </div>
74           </div> <!-- end unit size2of3 -->
75           <div class="unit size1of5 lastUnit">
76           
77           </div>                
78         </div>      
79       </div>
80
81 <?php get_footer(); ?>