WordPress.org

Ready to get started?Download WordPress

Forums

Category page with titles only (15 posts)

  1. prara
    Member
    Posted 9 years ago #

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

  2. Mark (podz)
    Support Maven
    Posted 9 years ago #

    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 !)

  3. prara
    Member
    Posted 9 years ago #

    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.

  4. Mark (podz)
    Support Maven
    Posted 9 years ago #

  5. prara
    Member
    Posted 9 years ago #

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

  6. WillM
    Member
    Posted 9 years ago #

    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.

  7. davidchait
    Member
    Posted 9 years ago #

    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

  8. prara
    Member
    Posted 9 years ago #

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

  9. Anonymous
    Unregistered
    Posted 9 years ago #

    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();}

  10. Anonymous
    Unregistered
    Posted 9 years ago #

    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

  11. haiiro
    Member
    Posted 8 years ago #

    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?

  12. moshu
    Member
    Posted 8 years ago #

    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

  13. haiiro
    Member
    Posted 8 years ago #

    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.

  14. haiiro
    Member
    Posted 8 years ago #

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

    Thanks, moshu! :)

  15. estjohn
    Member
    Posted 8 years ago #

    wanna post it?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.