Wordpress: more-Tag

yax

Erfahrenes Mitglied
Hey,

ich arbeite seit kurzem mit Wordpress. Ich habe mir ein extra Template für eine statische Seite erstellt, da ich eine weitere dynamische Seite benötige. Ich lasse mir alle Artikel aus der Kategorie "Blog" ausgeben, doch ich möchte gerne nur den Content eines Artikels bis zum more-Tag anzeigen lassen. Wie geht das?

Hier mein Template:
PHP:
<?
/*
Template Name: BlogTemplate
*/
?>
<?php get_header(); ?>

  <div id="maintext">
    <?php query_posts('category_name=Blog'); ?>
    <?php if(have_posts()) : while (have_posts()) : the_post(); ?>
            
    <?php 
      $comments_count = wp_count_comments($id);
    ?>
  
    <div class="artikel">
      <span class="date"><?php the_date('d.m.y'); ?></span>
      <span class="comments"><p>c</p><p class="count"><?php echo $comments_count->approved; ?></p></span>
      <a href="<?php the_permalink(); ?>"><h2 class="headline"><?php the_title(); ?></h2></a>
      <p><?php the_content(); ?></p>
    </div>
  
    <?php endwhile; ?>
    <?php endif; ?>
  
  </div>
  
  <div id="sidebar">
    <?php get_sidebar(); ?>
  </div>

<?php get_footer(); ?>
 
Okay, ich hab die Lösung gefunden:

man muss vor der zeile
PHP:
<?php the_content("Weiterlesen..."); ?>

einfach folgendes einfügen:
PHP:
<?php
  global $more;
  $more = 0;
?>

Gruß yax
 
Zurück