Title: Different .php layout for each category
Last modified: August 18, 2016

---

# Different .php layout for each category

 *  [bongkph](https://wordpress.org/support/users/bongkph/)
 * (@bongkph)
 * [18 years, 10 months ago](https://wordpress.org/support/topic/different-php-layout-for-each-category/)
 * Is it possible to call a different layout for a desired “category”
 * I have managed to create a different layout on home (home.php). How can I apply
   the same principles on a certain category?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [ssorcdivad](https://wordpress.org/support/users/forefront/)
 * (@forefront)
 * [18 years, 10 months ago](https://wordpress.org/support/topic/different-php-layout-for-each-category/#post-604130)
 * It’s in the Codex – category-id.php where ‘id’ is the ID of that category
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [18 years, 10 months ago](https://wordpress.org/support/topic/different-php-layout-for-each-category/#post-604149)
 * [http://codex.wordpress.org/Category_Templates](http://codex.wordpress.org/Category_Templates)
 *  Thread Starter [bongkph](https://wordpress.org/support/users/bongkph/)
 * (@bongkph)
 * [18 years, 10 months ago](https://wordpress.org/support/topic/different-php-layout-for-each-category/#post-604247)
 * Hi,
 * Tried that already but seems it will only work if user is browsing on the category
   and not on post.
 * example:
    [http://mywebsite/category-2](http://mywebsite/category-2) <— works,
   but on [http://mywebsite/category-2/post1](http://mywebsite/category-2/post1)
   <— doesnt work instead it is still using the template single.php.
 * On my site, I have static text and ads on all Post/Artciles of all the categories
   but I dont want to show this static text and ads on all the Post/Articles that
   are included in Category-2.
 * Is there a way to assign a specific layout (.php) for all the post within the
   category 12? Kindly give me simple steps to do because I am not well versed in.
   php.
 * Thanks a lot.
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [18 years, 10 months ago](https://wordpress.org/support/topic/different-php-layout-for-each-category/#post-604249)
 * [http://guff.szub.net/2005/07/21/post-templates-by-category/](http://guff.szub.net/2005/07/21/post-templates-by-category/)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Different .php layout for each category’ is closed to new replies.

## Tags

 * [layout](https://wordpress.org/support/topic-tag/layout/)

 * 4 replies
 * 4 participants
 * Last reply from: [moshu](https://wordpress.org/support/users/moshu/)
 * Last activity: [18 years, 10 months ago](https://wordpress.org/support/topic/different-php-layout-for-each-category/#post-604249)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
