Support » Fixing WordPress » Codex: Displaying post by Catagory id order

  • I was looking at the Codex for sorting post by title.
    So I’ve added the following lines to the theme index.php
    And added category_ID to below. But I seem to be missing something?

    Tia,
    David Jackson

    <?php get_header(); ?>

    <?php
    // we add this, to show *all* posts sorted
    // alphabetically by title
    $posts = query_posts($query_string . ‘&orderby=category_ID&order=asc&posts_per_page=-1’);
    // here comes The Loop!
    if (have_posts()) : while (have_posts()) : the_post(); ?>

Viewing 1 replies (of 1 total)
  • Thread Starter davidjackson

    (@davidjackson)

    Ok,
    It tried changing query line to this:

    $posts = query_posts($query_string . ‘&orderby=post_category&order=desc&posts_per_page=-1’);

    But keep getting this error:

    Parse error: parse error, unexpected $ in /www/t/thegatheringcf/htdocs/wordpress/wp-content/themes/Test/index.php on line 47

    tia,
    David

Viewing 1 replies (of 1 total)
  • The topic ‘Codex: Displaying post by Catagory id order’ is closed to new replies.