Hey,
auf meiner Seite möchte ich, dass bei längeren Texten nur ein Auszug angezeigt wird. Habe mich bereits hier im Forum und auf weiteren Seiten schlau gemacht, wie man soetwas realisieren kann.
Bin dort auf the_excerpt() und the_content() gestoßen.
In meiner Index.php Datei meines Templates steht folgendes:
PHP
<?php get_header(); ?>
<div id="content">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<div class="entrytop">
<div class="entry">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
</div>
</div>
<p class="postmeta"><?php the_time('F j, Y') ?> <?php _e('um'); ?> <?php the_time() ?> | <?php the_category(', ') ?><?php edit_post_link(__('Edit'), ' · ', ''); ?>
<br />
- Posted by <a href="<?php the_author_url(); ?>"><?php the_author(); ?></a> | <a href="http://www.ntmb.de/hit/8025">Werde auch Redakteur!</a>
<div class="post-content">
<?php the_content('Read the rest of this entry »'); ?>
</div>
</div>
<?php endwhile; ?>
<div class="navigation">
<span class="previous-entries"><?php next_posts_link('Ältere Artikel') ?></span> <span class="next-entries"><?php previous_posts_link('Neuere Artikel') ?></span>
</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><!--/content -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen
Ersetzte ich nun the_content() durch the_excerpt() (wie es in mehren Beiträgen hier schon beschrieben ist), wird zwar der Auszug angezeigt, allerdings ohne jegliche Bilder.
Wie kann ich das Ganze nun so umändern, dass der Auszug UND die Bilder zu dem Artikel auf der Startseite angezeigt werden?
Mfg