web/wp-content/themes/newsworthy/archive.php
changeset 1 0d28b7c10758
equal deleted inserted replaced
0:0d9a58d2c515 1:0d28b7c10758
       
     1 <?php get_header(); ?>
       
     2 
       
     3 <?php get_sidebar(); ?>
       
     4 
       
     5 <div id="main">
       
     6 
       
     7 <div class="middle">
       
     8 
       
     9 	<div class="box">
       
    10 
       
    11 
       
    12 
       
    13 	<h1>Archives</h1>
       
    14 
       
    15 
       
    16 
       
    17 <?php if ( is_category() || is_day() || is_month() ||
       
    18 
       
    19 						is_year() ) {
       
    20 
       
    21 			?>
       
    22 
       
    23 
       
    24 
       
    25 			<?php /* If this is a 404 page */ if (is_404()) { ?>
       
    26 
       
    27 			<?php /* If this is a category archive */ } elseif (is_category()) { ?>
       
    28 
       
    29 			<p>You are currently browsing the archives for the <?php single_cat_title(''); ?> category.</p>
       
    30 
       
    31 
       
    32 
       
    33 			<?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
       
    34 
       
    35 			<p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
       
    36 
       
    37 			for the day <?php the_time('l, F jS, Y'); ?>.</p>
       
    38 
       
    39 
       
    40 
       
    41 			<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
       
    42 
       
    43 			<p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
       
    44 
       
    45 			for <?php the_time('F, Y'); ?>.</p>
       
    46 
       
    47 
       
    48 
       
    49 			<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
       
    50 
       
    51 			<p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
       
    52 
       
    53 			for the year <?php the_time('Y'); ?>.</p>
       
    54 
       
    55 
       
    56 
       
    57 			<?php } ?>
       
    58 
       
    59 		<?php }?>
       
    60 
       
    61 
       
    62 
       
    63 	</div>
       
    64 
       
    65 
       
    66 
       
    67 </div>
       
    68 
       
    69 <div id="left">
       
    70 
       
    71 <?php 
       
    72 
       
    73 $style_classes = array('first','second','third');
       
    74 
       
    75 $style_index = 0;
       
    76 
       
    77 if (have_posts()) :
       
    78 
       
    79   while (have_posts()) : the_post();
       
    80 
       
    81 ?>
       
    82 
       
    83 	<div class="substory<?php $k = $style_index%3; echo " $style_classes[$k]"; $style_index++; ?>">
       
    84 
       
    85 		<?php if(get_post_meta($post->ID, "newsworthy_image_value", $single = true) != "") { ?><img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo get_post_meta($post->ID, "newsworthy_image_value", $single = true); ?>&amp;h=53&amp;w=140&amp;zc=1 ?>" alt="<?php the_title_attribute(); ?>" /><?php } ?>
       
    86 
       
    87 		<h2><?php the_title(); ?></h2>
       
    88 
       
    89 		<?php the_content_limit(57, "more"); ?>
       
    90 
       
    91 		<div class="postmeta"><a href="<?php the_permalink(); ?>" class="readmore">Read more...</a></div>
       
    92 
       
    93 	</div>
       
    94 
       
    95 <?php endwhile; endif; ?>
       
    96 
       
    97 
       
    98 
       
    99 
       
   100 
       
   101 	<div class="clear">&nbsp;</div>
       
   102 
       
   103 
       
   104 
       
   105 		
       
   106 
       
   107 </div>
       
   108 
       
   109 <div class="clearboth">&nbsp;</div>
       
   110 
       
   111 </div>
       
   112 
       
   113 
       
   114 
       
   115 <?php get_footer(); ?>