WordPress.org

Ready to get started?Download WordPress

Forums

Listing permalinks by category? (9 posts)

  1. mrd516
    Member
    Posted 9 years ago #

    Hi. I was wondering if there was a function (or a way to combine certain functions) to make it so I could list the permalinks for all posts in a certain category when viewing a category, rather than displaying all the posts in their entireties on a really long page? I've already checked the Doc section and the WIKI, and didn't find any particular function (or parameters for any particular function) that would seem to do the trick. I'd appreciate it if anyone had any ideas that may prove to be useful.

  2. Beel
    Member
    Posted 9 years ago #

    Ahh, but obviously you missed the "Search First" function.

  3. Kafkaesqui

    Posted 9 years ago #

    With a little PHP, you could perform an if/else on the loop section of your index.php, running a check to see if you're on a category page or not, and only provide the link when you are. Something like the following should work:
    if(!empty($cat)) {
    Category version of posts.
    } else {
    Default version of posts.
    }

  4. mrd516
    Member
    Posted 9 years ago #

    Um, I'm afraid I'm still not exactly sure how to accomplish this.
    And I did do a search but didn't find any threads that matched exactly what I was looking for. If you know for a fact I'm overlooking something that may be helpful, please kindly provide a link.

  5. Kafkaesqui

    Posted 9 years ago #

    Oh, and save a copy of index.php before moving around in it like this. Better safe...

  6. adeydas4
    Member
    Posted 9 years ago #

    And you can use the $single variable for individual posts too.

  7. mrd516
    Member
    Posted 9 years ago #

    The above will provide just the title of each post, as a link, IF you're on a category page.

    Will this only provide the links to the posts according to their respective categories? Sorry, I just wanna be positive this will do exactly what I'm looking to do before attempting it...

    And you can use the $single variable for individual posts too.

    Adeydas: care to elaborate? Would this be used in conjunction with Kafka's method, or are you talking about something completely different...?

  8. Anonymous
    Unregistered
    Posted 9 years ago #

    I think this link will provide your answer:
    http://elasticdog.com/2004/10/faking-multiple-templates/#more
    You can see it working on my site:
    http://www.planetphillip.com
    Just click a category on the right menu and you will see just post titles with permanlinks to the posts. I have formatted the way I like but you can of course make it look any way you want.

  9. Kafkaesqui

    Posted 9 years ago #

    Will this only provide the links to the posts according to their respective categories?

    Yep. WordPress takes care of this automatically on category pages anyway. All you're doing is verifying you're actually are on a category page, and acting accordingly.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.