Ich noch was anderes gemacht dann (mit Hilfe).
Also die single.php :
PHP
<?php get_header(); ?>
<?php get_sidebar(1); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="navigation">
<div class="alignleft"><?php previous_post_link('%link') ?></div>
<div class="alignright"><?php next_post_link('%link') ?></div>
<div class="clear"></div>
</div>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<div class="indent">
<div class="date">
<span><?php the_time('j') ?></span><?php the_time('M') ?>
</div>
<div class="title">
<h2 style=" float:none;"><?php the_title(); ?></h2>
</div>
</div>
<div class="text-box">
<?php
if(is_attachment())
{
$attachments = array_values(get_children( array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') ));
foreach ( $attachments as $k => $attachment )
{
if ( $attachment->ID == $post->ID )
break;
}
$next_url = isset($attachments[$k+1]) ? get_permalink($attachments[$k+1]->ID) : "";
$prev_url = isset($attachments[$k-1]) ? get_permalink($attachments[$k-1]->ID) : "";
?><p class="attachment">
<?php if($next_url != "") { ?>
<a href='<?php echo $next_url ;?>' title='<?php echo $post->post_title;?>'><img src="<?php echo $post->guid;?>" class="attachment-medium" alt="<?php echo $post->post_title;?>" title="<?php echo $post->post_title;?>" /></a>
<?php } else{?>
<img src="<?php echo $post->guid;?>" class="attachment-medium" alt="<?php echo $post->post_title;?>" title="<?php echo $post->post_title;?>" />
<?php } ?>
</p>
<?php
}else
the_content(''); ?>
</div>
<?php if(is_attachment())
{?>
<div class="navigation">
<div id="butnext"><?php
if($prev_url != "")
echo "<a id='textdeco' href='".$prev_url."'> << Vorheriges Bild >></a></div>";
if($next_url != "")
echo "<div id='butnext'><a id='textdeco' href='".$next_url."'> << Naechstes Bild >> </a>";
?></div>
<div class="alignright"><?php next_posts_link('Older Entries >') ?></div>
<div class="clear"></div>
</div>
<?php } ?>
<?php comments_template(); ?>
</div>
</div>
<?php endwhile; else: ?>
<h2 class="pagetitle">Sorry, no posts matched your criteria.</h2>
<?php endif; ?>
<?php get_sidebar(2); ?><?php get_sidebar(3); ?>
<?php get_footer(); ?>
Alles anzeigen