WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Sort Posts on Category Page Alphabetically

[Resolved] Sort Posts on Category Page Alphabetically

  • I am attempting to do as the topic describes: on category pages display all the posts in that category on one page alphabetically (by title).

    I am using the following code to do this currently:

    <?php
    $postslist = get_posts('numberposts=100&order=ASC&orderby=post_title');
    foreach ($postslist as $post) : start_wp(); ?>
    <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a> |
    			<small>
    			Posted on <?php the_time('M d Y');?>
    			</small>
    
    			</li>
    <?php endforeach; ?>

    It works.. but the problem currently is that it creates empty lines for all the posts, including ones not in that category.

    As that probably didn’t make much sense, see http://users.ice-berg.net/worldspinsmadlyon/?cat=3

    What am I doing wrong currently?

    Thanks in advance

Viewing 15 replies - 1 through 15 (of 16 total)
Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘[Resolved] Sort Posts on Category Page Alphabetically’ is closed to new replies.
Skip to toolbar