Get child cat, lists all posts only in that child cat
-
Hi there
I’ve scoured the forum and tried a bunch of code snippets, but without luck. I’m not a php wizard either so decided to ask here, whether I might be overlooking an easy fix.
I would like to get the child category of a single post that is displayed, and list all posts that fall into that child category (but not the parent!).
To explain, I am coding an academic journal, which has ‘article’ as a main category, and children for ‘issue 1′, issue 2’, etc. Whenever an article from, say, issue 3 is shown, I’d like to give, in a sidebar, all posts within this child category only (so not all ‘articles’). I am still struggling with the get_category and get_categories, and have had no luck. Ideally what I’d like my side bar to do/show is:
[get category -> get current child category]
[extract and echo child category name]
[list of all posts in this current child cat showing title and author]Thank you very much!
Seb
- The topic ‘Get child cat, lists all posts only in that child cat’ is closed to new replies.