Forums

List post titles only in categories and not the entire post (4 posts)

  1. miletjs
    Member
    Posted 3 years ago #

    Hello,

    Is there a way to list just the post titles when a particular category is pressed instead of the entire posts? Thanks in advance.

  2. Chris_K
    Administrator
    Posted 3 years ago #

    Sure, if you don't mind doing a wee bit of theme hacking. :-)

    Check out this link on Template_Hierarchy. From there, you'll see that if your theme has an archive.php it'll be called on to display category archives (or you can use category.php).

    Create one. Hack up The_Loop a bit to remove the_content or the_excerpt (those are what display the post).

  3. KatGirl
    Member
    Posted 3 years ago #

    When you think how the template is coded, its quite simple to get just titles showing in your category view.

    open your category template and look at the code. Depending on what theme you're using - you didn't mention - remove everything except:

    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>

    That will produce the post title within your coded HTML.

    Edit: Ah, forgot to mention that you'll need the Loop still in place.

  4. miletjs
    Member
    Posted 3 years ago #

    hi

    i tried this but it only produces 5 title links when i clicked on a category. i believe this is because my wordpress is setup to display 5 posts in each page. but what i want to have is when i clicked on a category, all titles of the posts for that category will be displayed.

    also, how about displaying per date then title. example:

    january 06
    post title 1
    post title 2

    february 06
    post title 1
    post title 2

    and so on.. ?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags