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
<?php 
/**
 * Loop
 *
 * @package WP Consultant
 * @subpackage Template
 */

global $ct_options;

$layout_type = $ct_options['ct_archive_layout_type'];

// Paged
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;

// Cat
$cat = get_query_var('cat');

// Get Image Attachements
$attachments = get_children(
    array(
	'post_type' => 'attachment',
	'post_mime_type' => 'image',
	'post_parent' => $post->ID
));
 
if (have_posts()) {		

	$args = array(
		'post_type' => 'post',
		'paged' => $paged,
		'cat' => $cat
	);
	$query = new WP_Query($args);

while ( $query->have_posts() ) : $query->the_post(); ?>
	
    <article <?php post_class(); ?>>
		
		<?php if($layout_type == "Full") { ?>
			<?php include(TEMPLATEPATH . '/includes/post-lead.php'); ?>
        <?php } elseif($layout_type == "Medium") { ?>
            <div class="onethirdcol left">
                <?php include(TEMPLATEPATH . '/includes/post-lead.php'); ?>
            </div>
        <?php } ?>
        
        <?php if($layout_type == "Full") { ?>
        
            <h3 class="marT20"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
            <?php include(TEMPLATEPATH . '/includes/post-meta.php'); ?>
            <div class="excerpt marB20">
                <?php the_excerpt(); ?>
            </div>
            <a class="btn right" href="<?php the_permalink(); ?>"><?php if($ct_read_more) { echo $ct_read_more; } else {  echo _e('Read more &rarr;', 'contempo'); } ?></a>
                <div class="clear"></div>
        
        <?php } elseif($layout_type == "Medium") { ?>
        
            <div class="twothirdcol right">
                <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
                <?php include(TEMPLATEPATH . '/includes/post-meta.php'); ?>
                <div class="excerpt marB20">
                    <?php the_excerpt(); ?>
                </div>
                <a class="btn right" href="<?php the_permalink(); ?>"><?php if($ct_read_more) { echo $ct_read_more; } else {  echo _e('Read more &rarr;', 'contempo'); } ?></a>
                    <div class="clear"></div>
            </div>
                <div class="clear"></div>  
                  
        <?php } ?>
        
    </article>
    
<?php endwhile; ?>

	<?php ct_content_nav(); ?>

<?php } else { ?>

    <p class="nomatches left clear"><?php _e( 'Apologies, but no results were found for the requested archive.<br />Perhaps searching will help find a related post.', 'contempo' ); ?></p>
    
<?php } wp_reset_query(); ?>