Hallo zusammen,
ich möchte gerne meine Blog so abändern, dass nur der erste Bietrag ganz angezeigt wird und die weiteren Beiträge auf der Startseite mit einem "weiter lesen" link abgekürzt werden...
Das sollte automatisch funktionieren ohne, dass der more tag bei jedem Artikel vom Autor eingebaut wird.
Ich habe dieses Feature bei dem Theme Prodown entdeckt und würde sie gerne in mein Theme einbauen.
So schaut die index.php bei Prodown aus.
Ich habe die Bereiche, die für die veränderte Anzeige verantwortlich sind markiert. Zumindest glaube ich, dass das die Bereiche sind :-)
Wenn ich den markierten Code aber versuche auf mein Theme zu übertragen, dann erhalte ich eine weiße Seite....
Hat jemand einen Tipp, wie ich dieses Feature auf andere Themes übertragen kann?
<?php get_header(); ?>
<div id="contentarea">
[B] <?php $x=TRUE; if (have_posts()) : ?>
<?php while (have_posts() && $x) : the_post(); ?>
<?php $x=FALSE; ?>[/B]
<div class="post">
<div class="posttop">
<div class="dateicon">
<div class="dateday"><?php the_time('d') ?></div>
<div class="datemonth"><?php the_time('M') ?></div>
</div>
<div class="posttitle">
<h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div class="postdetailstop">Posted by <?php the_author() ?>, in <?php the_category(', ') ?></div>
</div>
</div>
<div class="entry">
<?php the_content('Read the rest of this entry »'); ?>
<?php edit_post_link('Edit this post','',''); ?>
</div>
<?php include (TEMPLATEPATH . '/adsense.php'); ?>
</div>
<?php trackback_rdf(); ?>
<?php endwhile; ?>
<br/>
<?php else : ?>
<h2 class="center">Not Found</h2>
<p class="center"><?php _e("Sorry, but you are looking for something that isn't here."); ?></p>
<?php include (TEMPLATEPATH . "/searchform.php"); ?>
<?php endif; ?>
[B] <?php $y=TRUE; if (have_posts()) : ?>[/B]
<div class="post">
<div class="posttop">
<div class="posttitle">
<h2> Latest Posts</h2>
<div class="postdetailstop"> Latest from <?php bloginfo('name'); ?></div>
</div>
</div>
<div class="latestposts">
[B] <?php while (have_posts() && $y) : the_post(); ?>
<?php $y=TRUE; ?>[/B]
<div class="entry">
<strong>
<a id="post-<?php the_ID(); ?>" href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a>
</strong> <br/>
Posted on <?php the_time('l, F jS, Y') ?><br/>
[B] <?php the_excerpt() ?>[/B]
<a href="<?php the_permalink() ?>">Read Full Post</a>
<hr/>
</div>
<?php endwhile; ?></div><?php include (TEMPLATEPATH . '/adsense_latestposts.php'); ?>
</div><br/><br/><br/>
<?php endif; ?>
</div> <?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen