Ich möchte die Beiträge einer bestimmten Kategorie alphabetisch ordnen. Dank der Forensuche bin ich auf diese Seite gestossen: Alphabetizing Posts « WordPress Codex
Da ich keine category.php habe, habe ich die index.php meines Templates modifiziert und in category-28.php umbenannt. Aber egal wonach ich sortieren will, es ändert sich nichts!
Die category-28.php sieht nun so aus:
PHP
<?php
get_header();
?>
<div id="content">
<?php
// we add this, to show all posts in our
// Glossary sorted alphabetically
$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="post"><!-- the post -->
<h1 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h1>
<p class="date"><?php the_time(__('l, j. F Y G:i','avenue')) ?><?php edit_post_link(__(' | Eintrag bearbeiten','avenue'),'',''); ?></p>
<div class="entry"><!-- the entry -->
<?php the_content(__(' [...]','avenue')); ?>
</div><!-- end of the entry -->
<p class="info_m"><?php _e('Thema: ','avenue'); ?><?php the_category(', ') ?> <strong>| </strong>
<?php comments_popup_link(__('Kommentare (0)','avenue'), __('Kommentare (1)','avenue'), __('Kommentare (%)','avenue')); ?></p>
</div><!-- end of the post -->
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php posts_nav_link('','',__('« vorherige Beiträge','avenue')) ?></div>
<div class="alignright"><?php posts_nav_link('',__('nächste Beiträge »','avenue'),'') ?></div>
<div align="center"><?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?></div>
</div>
<?php else : ?>
<h2><?php _e('Nichts gefunden','avenue'); ?></h2>
<p><?php _e('Sorry, Du suchst nach etwas das nicht hier ist.','avenue'); ?></p>
<?php include (TEMPLATEPATH . "/searchform.php"); ?><?php endif; ?>
</div><!-- end of the content -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen
Gibt es noch eine andere Möglichkeit?