Hallo erst mal, ich hba bis jetzt alles durch die Suche hingekriegt usw, aber bei einer Sache komme ich jetzt nicht drauf wo der Fehler liegt.
Ich wollte die alphabetische Sortierung machen, die für die einzelnen Kategorien gilt. So, das hat funktioniert, aber so bald ich den Code einfüge (vor den Loop) verscheibt er mir die rechte Sidebar nach unten. Dafür ist es dann richtig sortiert, also klappt die Sortierung an sich schon mal, nur die Sidebar verzieht sich leider.
Hier von Category-1.php
<?php
// we add this, to show all posts in our
// Glossary sorted alphabetically
if (is_category('0-9'))
{
$posts = query_posts($query_string .
'&orderby=title&order=asc&posts_per_page=-1');
}
// here comes The Loop!
if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="entry<?php if(is_home() && $post==$posts[0] && !is_paged()) echo ' firstpost';?>">
<!--<h2 class="entrydate">
<?php the_date() ?>
</h2>-->
<h3 class="entrytitle" id="post-<?php the_ID(); ?>"> <a href="<?php the_permalink() ?>" rel="bookmark">
<?php the_title(); ?>
</a> </h3>
<div class="entrybody">
<div class="entrymeta">
<?php the_time('F dS Y') ?>
Posted in
<?php the_category(',') ?>
<?php edit_post_link(__('<strong>Edit</strong>')); ?>
</div>
<?php the_content(__('(...weiterlesen)')); ?>
<p class="storycontent">
<?php
$comments_img_link = '<img src="' . get_stylesheet_directory_uri() . '/images/comments.gif" title="comments" alt="*" />';
comments_popup_link(' Kommentare(0)', $comments_img_link . ' Kommentare(1)', $comments_img_link . ' Kommentare(%)');
?>
</p>
</div>
<!--
<?php trackback_rdf(); ?>
-->
</div>
<?php comments_template(); // Get wp-comments.php template
endwhile; else: ?>
<p>
<?php _e('Sorry, no posts matched your criteria.'); ?>
</p>
<?php endif; ?>
<p>
<?php posts_nav_link(' — ', __('« Vorherige Seite'), __('Nächste Seite »')); ?>
</p>
</div>
<!-- right sidebar-->
<?php include (TEMPLATEPATH.'/sidebarright.php') ?>
<!--close right sidebar-->
</div>
<?php get_footer(); ?>
</body>
</html>
Alles anzeigen
und hier von der orig index.php wo die sidebar richtig steht in den Categories
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="entry<?php if(is_home() && $post==$posts[0] && !is_paged()) echo ' firstpost';?>">
<!--<h2 class="entrydate">
<?php the_date() ?>
</h2>-->
<h3 class="entrytitle" id="post-<?php the_ID(); ?>"> <a href="<?php the_permalink() ?>" rel="bookmark">
<?php the_title(); ?>
</a> </h3>
<div class="entrybody">
<div class="entrymeta">
<?php the_time('F dS Y') ?>
Posted in
<?php the_category(',') ?>
<?php edit_post_link(__('<strong>Edit</strong>')); ?>
</div>
<?php the_content(__('(...weiterlesen)')); ?>
<p class="storycontent">
<?php
$comments_img_link = '<img src="' . get_stylesheet_directory_uri() . '/images/comments.gif" title="comments" alt="*" />';
comments_popup_link(' Kommentare(0)', $comments_img_link . ' Kommentare(1)', $comments_img_link . ' Kommentare(%)');
?>
</p>
</div>
<!--
<?php trackback_rdf(); ?>
-->
</div>
<?php comments_template(); // Get wp-comments.php template
endwhile; else: ?>
<p>
<?php _e('Sorry, no posts matched your criteria.'); ?>
</p>
<?php endif; ?>
<p>
<?php posts_nav_link(' — ', __('« Vorherige Seite'), __('Nächste Seite »')); ?>
</p>
</div>
<!-- right sidebar-->
<?php include (TEMPLATEPATH.'/sidebarright.php') ?>
<!--close right sidebar-->
</div>
<?php get_footer(); ?>
</body>
</html>
Alles anzeigen
Sortierung klappt, sidebar rutscht nach unten: http://www.ruhr-tel.de/?cat=1
original wo die Sidebar so ist wie sie sein soll: http://www.ruhr-tel.de/?cat=2
wie gesagt, sorry fürs belästigen, alle anderen fragen wurden durch die suche beantwortet aber hier komme ich einfach nicht drauf woran es liegt.