Report abuse

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
<?php get_header(); ?>
<!--include sidebar-->
<?php include(TEMPLATEPATH."/l_sidebar.php");?>

<div id="content">
    <!--archive.php-->

<!-- Below for alphabetical listing at top of each page -->
<?php //if (function_exists('wp_snap')) { echo wp_snap(); } ?>
<br />

<?php 

$query = "SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) LEFT OUTER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id AND wp_postmeta.meta_key = 'lastname') WHERE 1=1 AND  wp_term_taxonomy.taxonomy = 'category' AND wp_term_taxonomy.term_id IN ('5') AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY COALESCE(wp_postmeta.meta_value, post_title) ASC, post_title ASC";

$pageposts = $wpdb->get_results($query, OBJECT); 

?>

    <?php if ( $pageposts ) : // the loop ?>

    <h1><?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>

    <?php /* If this is a category archive */ if (is_category()) { ?>				
        <?php echo single_cat_title(); ?>
		
 	<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
		Archive for <?php the_time('F jS, Y'); ?>
		
    <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
		Archive for <?php the_time('F, Y'); ?>

    <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
		Archive for <?php the_time('Y'); ?>
		
    <?php /* If this is a search */ } elseif (is_search()) { ?>
		Search Results
		
	<?php /* If this is an author archive */ } elseif (is_author()) { ?>
	    Author Archive

    <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
		Blog Archives

	<?php } //do not delete ?>

    </h1>

    <?php foreach ($pageposts as $post) : setup_postdata($post); // the loop ?>

                <div id="post-<?php the_ID(); ?>" class="thumbnail"> 
<a href="<?php echo get_permalink() ?>" class="thumbnailer" rel="bookmark" title="<?php the_title(); ?>"><h3 id="post-<?php the_ID(); ?>"><?php the_title(); ?></h3><span><img src="<?php echo get_post_meta($post->ID, "Thumbnail", true); ?>" /></span></a>
</div>

    <?php endforeach; //end one post ?>

    <!-- Previous/Next page navigation -->
    <div class="page-nav">
    <div class="nav-new"><?php if(function_exists('wp_page_numbers')) { wp_page_numbers(); } ?>
</div>
<!--    Remove this becuase the new plugin displays page numbers
<div class="nav-next"><?php //if(function_exists('wp_page_numbers')) { wp_page_numbers(); } ?>
</div> -->
    </div>   

	<?php else : //do not delete ?>

    <h3>Page Not Found</h3>
    <p>We're sorry, but the page you are looking for isn't here.</p>
    <p>Try searching for the page you are looking for or using the navigation in the header or sidebar</p>

	<?php endif; //do not delete ?>
		
	
<!--archive.php end-->
</div>

<!--include footer-->
<?php get_footer(); ?>