web/wp-content/themes/newsworthy/index.php
author ymh <ymh.work@gmail.com>
Mon, 22 Mar 2010 16:36:28 +0100
changeset 5 ac511f1ccc8e
parent 1 0d28b7c10758
permissions -rw-r--r--
add hgignore

<?php get_header(); ?>

<?php get_sidebar(); ?>

<div id="main">

	<div class="topstory">

<?php $the_query = new WP_Query('showposts=1');

if ($the_query->have_posts()) :

  while ($the_query->have_posts()) : $the_query->the_post();

  $do_not_duplicate = $post->ID;

?>

	<?php if(get_post_meta($post->ID, "newsworthy_image_value", $single = true) != "") { ?><img src="<?php echo get_post_meta($post->ID, "newsworthy_image_value", $single = true); ?>" alt="<?php the_title_attribute(); ?>" /><?php } ?>

	<h1><?php the_title(); ?></h1>

	<?php the_excerpt(); ?>

		<div class="postmeta"><a href="<?php the_permalink(); ?>" class="readmore">Read more...</a><a href="<?php comments_link(); ?>" class="comments">Comments (<?php comments_number('0', '1', '%');  ?>)</a><span class="category">Filed under: <?php the_category(', ') ?></span></div>

<?php endwhile; endif; ?>

	</div>

<div class="middle">

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Home Middle") ) : ?>

	<div class="box">

	<h1>Middle</h1>

	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vivamus pretium pede eget neque.</p>

	</div>

	<img class="banner" src="<?php bloginfo('template_url'); ?>/images/banner.jpg" alt="125x125 Banner" />

<?php endif; ?>

</div>

<div id="left">

<?php $the_query = new WP_Query('showposts=6&offset=1');

$style_classes = array('first','second','third');

$style_index = 0;

if ($the_query->have_posts()) :

  while ($the_query->have_posts()) : $the_query->the_post();

if  ( $post->ID == $do_not_duplicate ) { continue; update_post_caches($posts); }

?>

	<div class="substory<?php $k = $style_index%3; echo " $style_classes[$k]"; $style_index++; ?>">

		<?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 } ?>

		<h2><?php the_title(); ?></h2>

		<?php the_content_limit(90, "more"); ?>

		<div class="postmeta"><a href="<?php the_permalink(); ?>" class="readmore">Read more...</a></div>

	</div>

<?php endwhile; endif; ?>





	<div class="clear">&nbsp;</div>



				<div class="halfcontent left">

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Home Left") ) : ?>

					<h2>About this template</h2>

					<p><img class="left" src="<?php bloginfo('template_url'); ?>/images/boat.jpg" alt="About Me" />Newsworthy is the 16th template from <a href="#">DemusDesign</a>. It's a magazine-style template built on a 6-column grid that's perfect as a news site or any site with a lot of information. It includes a demo of a <a href="#">blog post</a> and a <a href="#">style demo</a>.</p>				

<?php endif; ?>

				</div>

				<div class="halfcontent left">

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Home Right") ) : ?>

					<h2>License and Use</h2>

					<p>Newsworthy is released under the <a href="http://creativecommons.org/licenses/by/2.5/">Creative Commons 2.5</a> license, which means you can use it free, and even make derivative works, so long as you keep the attribution link back to <a href="http://demusdesign.com">DemusDesign</a> in the footer. If you do use it, contact me through my site to let me know. I love seeing my templates at work! Thanks.</p>					

<?php endif; ?>

				</div>

</div>

<div class="clearboth">&nbsp;</div>

</div>



<?php get_footer(); ?>