Title: Help Understanding Category Structure   Code Help
Last modified: August 20, 2016

---

# Help Understanding Category Structure Code Help

 *  [CodeyMonkey](https://wordpress.org/support/users/codeymonkey/)
 * (@codeymonkey)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/help-understanding-category-structure-code-help/)
 * Hi,
 * I’m trying to see how categories work together, and wondered if you could see
   if i’m doing this right.
 * I’m creating a portfolio website and need the structure like this:
 * (My permalink structure is “/%category%/%postname%/”
 * Parent Category: mysite.com/portfolio/
    Child Category: mysite.com/portfolio/
   photography/ Single Post Entry mysite.com/portfolio/photography/single-post-url
 * Child Categories can not be hard coded, e.g. category_photography.php
 * So I need code that says something like:
 * If Category is a “Parent” then show this code…. else…. Show the children code….
 * All this is within category.php….
 * Hope someone can assist.

The topic ‘Help Understanding Category Structure Code Help’ is closed to new replies.

## Tags

 * [categories](https://wordpress.org/support/topic-tag/categories/)
 * [category](https://wordpress.org/support/topic-tag/category/)
 * [parent](https://wordpress.org/support/topic-tag/parent/)
 * [Sub-Category](https://wordpress.org/support/topic-tag/sub-category/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [CodeyMonkey](https://wordpress.org/support/users/codeymonkey/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/help-understanding-category-structure-code-help/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
