WordPress.org

Ready to get started?Download WordPress

Forums

sorting & categories (8 posts)

  1. jonanhold
    Member
    Posted 10 years ago #

    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.

  2. jonanhold
    Member
    Posted 10 years ago #

    i actually just figured out how to do #3. still looking for a way to tell it which categories to display (or not display).
    :)

  3. Dougal Campbell
    Member
    Posted 10 years ago #

    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.

  4. jonanhold
    Member
    Posted 10 years ago #

    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? :)

  5. jonanhold
    Member
    Posted 10 years ago #

    ok, how to specify multpile categories.. anyone? :)

  6. Mike Little
    Member
    Posted 10 years ago #

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

  7. jonanhold
    Member
    Posted 10 years ago #

    Ok. Maybe I'll look at hacking it into the current release :)

  8. southerngal
    Member
    Posted 10 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.