Zitat von Lars337also bei mir geht das nicht weil ich auf der Startseite gerne einen Statischen Text, den letzten Blog-Eintrag und noch eine andere dynamische Tabelle anzeigen will!
Bei mir funktioniert das so, wie du es beschreibst (im Zusammenhang mit Static Front):
http://lsr-brb.de
index.php meines Themes:
PHP
<?php get_header(); ?>
<div id="content" class="narrowcolumn">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<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><?php the_time('j. F Y') ?> <!-- by <?php the_author() ?> --></small>
<div class="entry">
<?php the_content('<p class="serif"><strong>Weiterlesen »</strong></p>'); ?>
<?php link_pages('<p><strong>Seiten:</strong> ', '</p>', 'number'); ?>
</div>
<p class="postmetadata">Abgelegt unter <?php the_category(', ') ?> <strong>|</strong> <?php edit_post_link('Bearbeiten','','<strong>|</strong>'); ?> Autor: <?php the_author_posts_link(); ?><!-- <?php comments_popup_link('Keine Kommentare »', '1 Kommentar »', '% Kommentare »'); ?>--></p>
</div>
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Frühere Beiträge') ?></div>
<div class="alignright"><?php previous_posts_link('Neuere Beiträge »') ?></div>
</div>
<?php else : ?>
<h2 class="center">Nichts gefunden</h2>
<p class="center">Du hast nach etwas gesucht, das es hier nicht gibt.</p>
<?php include (TEMPLATEPATH . "/searchform.php"); ?>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen
home.php meines Themes (auf die kommt es an):
PHP
<?php get_header(); ?>
<div id="content" class="narrowcolumn">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2>Willkommen</h2>
<div class="entry">
<?php the_content('<p class="serif"><strong>Weiterlesen »</strong></p>'); ?>
<?php link_pages('<p><strong>Seiten:</strong> ', '</p>', 'number'); ?>
</div>
<br></br>
<p class="trenner alt">Aktuelles</p>
<?php
$posts = get_posts('numberposts=3&category=1');
foreach($posts as $post) :
setup_postdata($post);
?>
<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><?php the_time('j. F Y') ?> <!-- by <?php the_author() ?> --></small>
<div class="entry">
<?php the_content('<p class="serif"><strong>Weiterlesen »</strong></p>'); ?>
<?php link_pages('<p><strong>Seiten:</strong> ', '</p>', 'number'); ?>
</div>
<p class="postmetadata">Abgelegt unter <?php the_category(', ') ?> <strong>|</strong> <?php edit_post_link('Bearbeiten','','<strong>|</strong>'); ?> Autor: <?php the_author_posts_link(); ?></p>
</div>
<?php endforeach; ?>
</div>
<?php endwhile; ?>
<?php else : ?>
<!--<h2 class="center">Nichts gefunden</h2>
<p class="center">Du hast nach etwas gesucht, das es hier nicht gibt.</p>-->
<?php include (TEMPLATEPATH . "/searchform.php"); ?>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen
Das
ggf. rausnehmen, das ist nur eine Anpassung die ich wegen dem EventCalendar-Plugin drin habe.