WordPress.org

Support

Support » How-To and Troubleshooting » Category page with titles only

Category page with titles only

  • How do I do that (points up): a category page with only the titles of the posts belonging to that category?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Like this ?
    http://www.tamba2.org.uk/T2/archives/category/reference/
    I installed the nicer archives hack (and yes, that css of mine is appalling !)

    Not exactly like that. Where is the nicer archives hack?
    Here is an example:
    I have two posts in General category and I only want to see the titles of those two posts when I goto the General category page.

    That does not help. But it is a good way of archiving posts.

    The only way I could think of to do it would be to make a modified index.php with only time and title tags (maybe extracts too, depending on how many posts you have) and then setting it to only display one category.
    Unfortunately you would only get as many posts listed as you had set for the index page to display, though you might be able to pass a new value for posts per page to override your settings – haven’t tried that yet, but it could work.

    you can detect if you are on a category page generally if !empty($cat) — that catches the general-case situations.
    Then, where you’d normally output the_content in your index.php file, check cat first. i.e.

    <?php if (empty($cat)) the_content(); ?>

    Something like that work for you?
    -d
    http://www.chait.net

    works exactly for me, take a look:
    http://www.premrara.com/archives/category/advocacy/

    It should work with Matt’s “nicer archives” hack. I use a modified version of that, although I don’t remember exactly what I modified.
    Matt’s hack is somewhere on the Wiki.
    Basically, you do a general check to see if you’re in some kind of archive, then proceed to display content according to what kind of archive it is (i.e. whether based on category or time)
    You may also need this for your heading (not sure if it’s in the original hack):
    if($cat) {single_cat_title();}

    And old thread, but here is my solution anyway
    <A href=”http://www.jehiah.com/archive/wordpress-category-page-hacks”>http://www.jehiah.com/archive/wordpress-category-page-hacks

    Between David Chait’s category detection post and Prem Rara’s “got it!” post, what transpired?

    I’ve been trying to get category archives to display as title lists for several hours, and had no luck whatsoever. I’ve scoured the codex and the support forums, and visited sites of folks that have made it work — no luck yet.

    What am I missing?

    haiiro, don’t dig up topics older than a year.
    Since v1.5 the whole thing is very easy to do: just use a category.php template and in The_Loop leave just the_title tag (and delete the_excerpt or the_content).
    See also Category_Templates

    Sorry about that, moshu. I figured it would be better than starting a fresh topic.

    I’d already looked at both of those Codex pages, and didn’t see how they would help — I’ll take another look.

    Got it! I kludged in a bit of other code to get them to display alphabetically, and all is well.

    Thanks, moshu! 🙂

    wanna post it?

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Category page with titles only’ is closed to new replies.
Skip to toolbar