Hallo zusammen,
Ich setze zwei dynamische Seiten auf meinem Blog ein. Auf der einen veröffentliche ich schriftliche News und auf der anderen meinen Podcast. Ich habe dies bisher so gelöst, dass die Hauptseite die Kategorie Podcasts nicht anzeigt und die die Podcast Seite schlicht durch deren Archiv-Page verwirklicht wird.
Mit meinem neuen Theme taucht allerdings ein Problem auf. Der neuste Post (Hauptpost welcher gross angezeigt wird) wird sowohl auf der Startseite als auch auf der Podcast-Seite angezeigt. Was stimmt mit dem Loop bei der category.php nicht? Welche Modifikation ist notwendig?
Mein Blog: bigh.ch
category.php:
PHP
<?php get_header(); ?>
<div id="content">
<?php include (TEMPLATEPATH . '/menu.php'); ?>
<?php if (have_posts()) : ?>
<?php $firstpostquery = new WP_Query('showposts=1'); ?>
<?php while($firstpostquery->have_posts()) : $firstpostquery->the_post(); $firstpost = $post->ID; ?>
<div class="entry">
<div class="post" id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<small>Written by <?php the_author() ?> on <abbr title="<?php the_time('Y-m-d\TH:i:sO'); ?>"><?php unset($previousday); printf(__('%1$s – %2$s'), the_date('', '', '', false), get_the_time()) ?></abbr> - <?php if(function_exists('the_views')) { the_views(); } ?> </small>
<div class="line"></div>
<?php the_content('Read the rest of this entry »'); ?>
<div class="postinfo"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?> <img src="<?php bloginfo('template_directory'); ?>/i/cm.gif" alt="comment" /> | Posted in » <?php the_category(', ') ?> <?php edit_post_link('| Edit', '', ' | '); ?> </div>
</div>
</div>
<div class="googleads1" align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-0415067011684436";
//468x60, Erstellt 17.01.08
google_ad_slot = "0293835448";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php if (have_posts()) : ?>
<?php $count=0; while (have_posts()) : the_post(); if(!($firstpost == $post->ID)) : ?>
<?php if($count % 2 == 0) echo '<div class="left">'; else echo '<div class="right">'; ?>
<div class="post" id="post-<?php the_ID(); ?>" style="">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<small><abbr title="<?php the_time('Y-m-d\TH:i:sO'); ?>"><?php unset($previousday); printf(__('%1$s – %2$s'), the_date('', '', '', false), get_the_time()) ?></abbr> <!-- by <?php the_author() ?> --></small>
<div class="clear"></div>
<p><?php the_content_rss('', TRUE, '', 30) ; ?></p><div class="clear"></div>
</div>
</div>
<?php if($count % 2 != 0) echo '<div class="clear"></div>';?>
<?php $count++; endif; ?>
<?php endwhile; ?>
<div style="clear:both"></div>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Previous Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Next Entries »') ?></div>
</div>
<?php else : ?>
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen
Gruss bigh