Title: Multiple layout for posts
Last modified: January 12, 2018

---

# Multiple layout for posts

 *  [mortonc](https://wordpress.org/support/users/mortonc/)
 * (@mortonc)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/multiple-layout-for-posts/)
 * I have a page layout which I am using for a custom post type.
    lets say each 
   page is at mysite.com/customtype/mypost
 * I would like to have a second layout for this page to basically show a slightly
   altered / more concise version (using the same post info) which could be accessed
   at something like mysite.com/customtype/mypost/alt or mysite.com/customtype/mypost?
   alt or similar.
 * What might be the best way of going about this?

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

 *  [Peter Hardy-vanDoorn](https://wordpress.org/support/users/petervandoorn/)
 * (@petervandoorn)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/multiple-layout-for-posts/#post-9858041)
 * I’d go about it with a query string and CSS.
 * Add a query string to your links, so something like `mysite.com/customtype/mypost?
   myview=concise`
 * Then at the top of your _single-customtype.php_, have `$myview = $_GET['myview'];`
 * Add this to your body classes in _header.php_ (how you do this depends on your
   theme, but for me it’d be `<body <?php body_class( $myview ); ?>>`).
 * Finally you can easily control what is and isn’t seen using CSS, eg `body.concise.
   myclass { display: none; }`
 * Hope that helps
 *  Thread Starter [mortonc](https://wordpress.org/support/users/mortonc/)
 * (@mortonc)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/multiple-layout-for-posts/#post-9858728)
 * Thank you Peter that is very helpful.
 * But if I wanted to have a completely different layout all together how would 
   I go about doing that?
 *  [Peter Hardy-vanDoorn](https://wordpress.org/support/users/petervandoorn/)
 * (@petervandoorn)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/multiple-layout-for-posts/#post-9859394)
 * That’s the beauty of CSS… the same HTML can be displayed in different ways.
 * For example, a box can be floated right for normal view, or floated left for 
   another, eg:
 *     ```
       .myclass { float: right; }
       body.concise .myclass { float: left; }
       ```
   
 * Doing it that way would keep your development to a minimum as you’d only need
   one set of code.
 * But, if you wanted to, the query string can still be used, eg:
 *     ```
       $myview = $_GET['myview'];
       if ( $myview != "concise" ) {
       	// code to display normal view
       } else {
       	// code to display concise view
       }
       ```
   
 * Oh, BTW, when I said originally “at the top of your single-customtype.php” I 
   meant “at the top of _header.php_“!
 * Peter

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

The topic ‘Multiple layout for posts’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Peter Hardy-vanDoorn](https://wordpress.org/support/users/petervandoorn/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/multiple-layout-for-posts/#post-9859394)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
