So sieht die aus:
index.php:
PHP
<?php get_header(); ?>
<!--Begin Featured Posts include-->
<?php include (TEMPLATEPATH . '/featured.php'); ?>
<!--End Featured Posts include-->
<div id="content">
<div id="featured_box">
<div style="clear: both"></div>
</div>
<!--Begin Recent Posts -->
<div id="hprecent">
<?php $my_query = new WP_Query('showposts=8');
while ($my_query->have_posts()) : $my_query->the_post();
// check for thumbnail
$thumb = get_post_meta($post->ID, 'thumbnail', $single = true);
$do_not_duplicate = $post->ID; ?>
<div class="entry<?php if(!$thumb) echo " entry-wide"; ?>">
<?php // if there's a thumbnail
if($thumb !== '') { ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php echo $thumb; ?>" alt="<?php the_title(); ?>" /></a>
<?php } // end if statement
// if there's not a thumbnail
else { echo ''; } ?>
<div class="post">
<h2><a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a></h2>
<?php the_excerpt(); ?>
</div>
<div style="clear: both"></div>
</div>
<?php endwhile; ?>
<div style="clear: both"></div>
</div>
<!--End Recent Posts-->
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen
Archiv.php:
PHP
<?php get_header(); ?>
<!--Begin Featured Posts include-->
<?php include (TEMPLATEPATH . '/featured.php'); ?>
<!--End Featured Posts include-->
<div id="content">
<?php if (have_posts()) : ?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
<h2 class="pagetitle">Archive for the ‘<?php single_cat_title(); ?>’ Category</h2>
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<h2 class="pagetitle">Archive for <?php the_time('F jS, Y'); ?></h2>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<h2 class="pagetitle">Archive for <?php the_time('F, Y'); ?></h2>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<h2 class="pagetitle">Archive for <?php the_time('Y'); ?></h2>
<?php /* If this is an author archive */ } elseif (is_author()) { ?>
<h2 class="pagetitle">Author Archive</h2>
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h2 class="pagetitle">Blog Archives</h2>
<?php } ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post">
<h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
<small><?php the_time('F jS, Y') ?></small>
<div class="entry">
<?php the_content('Read more ... »'); ?>
</div>
<p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
<hr /><br />
</div>
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
<div style="clear:both;"></div>
</div>
<?php else : ?>
<h2 class="center">Not Found</h2>
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen