moin moin,
ich bräuchte mal wieder eine PHP-Hilfe für folgendes Anliegen.
Auf der Index soll eine andere H2 ausgegeben werden.
momentan schauts so aus:
PHP
<div class="post" id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
ich habs damit versucht:
[LEFT]
PHP
<?php if (is_front_page()){
echo '<h2>TESTSTARTSEITE</h2>';
}else{
echo '<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>';
}?>
So erhalte ich zwar auf der Startseite ein manuell vergebbare Überschrift aber auf den anderen statischen Seiten (ich benutze nur statische Seiten) gar keine Überschrift mehr.
Jede andere Version dem if/else beizukommen fürht zu fatal Errors.
Kann mir mal jemand sagen wie es lauten muss.
Hier mal der Inhalt der index.php
PHP
<?php get_header(); ?>
<div id="content">
<div id="blog">
<?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_attribute(); ?>"><?php the_title(); ?></a></h2>
<div class="entry">
<?php the_content('Read the rest of this entry »'); ?>
</div>
<p class="meta"><?php the_tags('Tags: ', ', ', '<br />'); ?></p>
<div class="hr">
<hr />
</div>
<!-- end #post-1 -->
</div>
<!-- end #blog -->
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen
Gruss axel
[/LEFT]