Hallo Leute,
gerade bin ich an einem WordPressProjekt, wo ich ein eigenes Design benutze. Da is gerade das Problem, das es egal ist ob ich gerade Single.php oder Page.php habe.
Es werden immer nur die Artikel angezeigt.
Ich hab den Code der Page.php mehrfach geändert und finde leider nie den fehler.
Quellcode index.php:
PHP-Code:
<?php get_header(); ?>
<?php get_sidebar();?>
<div id="content">
<p> </p><?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanenter Link zu diesem Artikel"><?php the_title(); ?></a></h1><br/>
<?php the_content(' weiterlesen ...'); ?>
<br/>
<ul class="postinfo floatbox">
<li class="infotime"><?php the_time('j. F Y'); ?></li>
<li class="infoauthor"><?php the_author(); ?></li>
<li class="infokategorie"><?php the_category(', ', '') ?></li>
<?php if (is_single() || is_page()) : ?>
<li class="infocomments"><a href="#comments" title="zu den Kommentaren springen"><?php comments_number('kein Kommentar', '1 Kommentar', '% Kommentare', ''); ?></a></li>
<?php else : ?>
<li class="infocomments"><?php comments_popup_link('kein Kommentar', '1 Kommentar', '% Kommentare', '', 'Kommentare sind abgeschaltet.'); ?></li>
<?php endif; ?>
<?php edit_post_link('bearbeiten','<li class="infoedit">','</li>'); ?>
</ul>
<br/>
<br/>
</div>
<?php endwhile; ?>
<div class="pagination">
<p class="float_left"><?php next_posts_link("« ältere Beiträge") ?></p>
<p class="float_right"><?php previous_posts_link('neuere Beiträge »') ?></p>
</div>
<?php else : ?>
<h2>Nicht gefunden</h2>
<p>Sorry, aber du suchst gerade nach etwas, was hier nicht ist.</p>
<?php endif; ?>
</div><br/>
<?php get_footer(); ?>
Quellcode page.php:
PHP-Code:
<?php get_header(); ?>
<?php get_sidebar();?>
<div id="content">
<p> </p><?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanenter Link zu diesem Artikel"><?php the_title(); ?></a></h1>
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
<br/>
</div>
<?php endwhile; ?>
<?php else : ?>
<h2>Nicht gefunden</h2>
<p>Sorry, aber du suchst gerade nach etwas, was hier nicht ist.</p>
<?php endif; ?>
</div><br/>
<?php get_footer(); ?>
Quellcode single.php:
PHP-Code:
<?php get_header(); ?>
<?php get_sidebar();?>
<div id="content">
<p> </p><?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanenter Link zu diesem Artikel"><?php the_title(); ?></a></h1>
<br/>
<?php the_content(); ?>
<br/>
<ul class="postinfo floatbox">
<li class="infotime"><?php the_time('j. F Y'); ?></li>
<li class="infoauthor"><?php the_author(); ?></li>
<li class="infokategorie"><?php the_category(', ', '') ?></li>
<?php if (is_single() || is_page()) : ?>
<li class="infocomments"><a href="#comments" title="zu den Kommentaren springen"><?php comments_number('kein Kommentar', '1 Kommentar', '% Kommentare', ''); ?></a></li>
<?php else : ?>
<li class="infocomments"><?php comments_popup_link('kein Kommentar', '1 Kommentar', '% Kommentare', '', 'Kommentare sind abgeschaltet.'); ?></li>
<?php endif; ?>
<?php edit_post_link('bearbeiten','<li class="infoedit">','</li>'); ?>
</ul>
<br/>
</div>
<?php endwhile; ?>
<div class="pagination">
<p class="float_left"><?php next_posts_link("« ältere Beiträge") ?></p>
<p class="float_right"><?php previous_posts_link('neuere Beiträge »') ?></p>
</div>
<?php else : ?>
<h2>Nicht gefunden</h2>
<p>Sorry, aber du suchst gerade nach etwas, was hier nicht ist.</p>
<?php endif; ?>
</div><br/>
<?php get_footer(); ?>