WordPress.org

Support

Support » How-To and Troubleshooting » sorting & categories

sorting & categories

  • i’m looking for a way to do a few things:
    1) limit which categories are shown on the “main” page.
    2) build a page which shows only one category.
    3) sort posts selectively (with a query string?) from oldest to newest without making that the default.

Viewing 7 replies - 1 through 7 (of 7 total)
  • i actually just figured out how to do #3. still looking for a way to tell it which categories to display (or not display).
    🙂

    There’s some SuperSecret stuff you can do to achieve this. At risk to my own life, I’m going to pass some of those secrets on to you….
    Let’s say you’ve got a category named “Internal” with cat_ID 6, and you don’t want to display Internal posts on your main page… Edit your ‘index.php’ template, and hear the top, just before the <b>require_once(‘blog.header.php’);</b>, insert a new line that says <b>$cat=’-6′;</b>. This will suppress category 6 in your main page.
    Now, to make a new page that <i>only</i> shows category 6, make a copy of index.php, named, oh, let’s say ‘internal.php’. At the top of that template, insert a line that says <b>$cat=’6′;</b> (instead of the negative 6 that we put in the main template).
    I’ve only played with this a little bit, myself, so I’m not sure if there are any quirks.

    that’s cool. i had suspected that something like that was possible, but i hadn’t read into the code far enough to see if it’d honor that.
    now.. is there a way to make get_archives() only show entries from the category on the page? 🙂

    ok, how to specify multpile categories.. anyone? 🙂

    Hi Jon,
    WordPress does not currently support multiple categories, sorry.
    There are plans to add that functionality in a future release.
    Mike

    Ok. Maybe I’ll look at hacking it into the current release 🙂

    I can’t wait for the next release, so it will offer multiple categories along with other thing! 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘sorting & categories’ is closed to new replies.