• 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.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Ahh, but obviously you missed the “Search First” function.

    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.
    }

    Thread Starter mrd516

    (@mrd516)

    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.

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

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

    Thread Starter mrd516

    (@mrd516)

    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…?

    I think this link will provide your answer:
    https://elasticdog.com/2004/10/faking-multiple-templates/#more
    You can see it working on my site:
    https://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.

    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.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Listing permalinks by category?’ is closed to new replies.