Title: Hiding Post bodys&#8230;
Last modified: August 18, 2016

---

# Hiding Post bodys…

 *  [AJ](https://wordpress.org/support/users/aj/)
 * (@aj)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/hiding-post-bodys/)
 * I have a strange problem… basically, I want to take the piece of code that tells
   wp-comments when to display (ie when you click on the permalink) and use that
   to only display the post body when you click the permalink, if that makes sense…
 * So, what is the part of the file that checks for the ?p=xyz or whatever…
 * Thanks all
 * AJ

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

 *  [TechGnome](https://wordpress.org/support/users/techgnome/)
 * (@techgnome)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/hiding-post-bodys/#post-125700)
 * What version are you using? There’s a way to do that, but it depends if you are
   using 1.2.x or 1.[3|5]
 * Tg
 *  [Nick Momrik](https://wordpress.org/support/users/mtdewvirus/)
 * (@mtdewvirus)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/hiding-post-bodys/#post-125702)
 * An easy way would be to place whatever code you only want to see on a permalinked
   page in between these….
    `<?php if (!$single) { ?>` and `<?php } ?>`
 * What that does is if it’s not a single post page, the code in between is run.
   The code in between can be simply the portion that calls the post body (function
   the_content) or whatever you want.
 *  Thread Starter [AJ](https://wordpress.org/support/users/aj/)
 * (@aj)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/hiding-post-bodys/#post-125704)
 * it’s 1.2.2… TechGnome…
 * MtDew, that looks like a nice way to do it!
 * Thanks for the quick response guys!
 *  [TechGnome](https://wordpress.org/support/users/techgnome/)
 * (@techgnome)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/hiding-post-bodys/#post-125710)
 * just to expound on MDV’s answer, the way I’d do it (and have done it) is like
   this :
    <?php if(!$single) { the_excerpt(); }else{ the_content(); } ?>
 * That gives the excerpt text on the main page, but gives the full text on individual
   pages.
 * Tg
 *  [Nick Momrik](https://wordpress.org/support/users/mtdewvirus/)
 * (@mtdewvirus)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/hiding-post-bodys/#post-126569)
 * TechGnome…why not save an extra character. 😉
 * `<?php if($single) {
    the_content(); }else{ the_excerpt(); } ?>
 *  [TechGnome](https://wordpress.org/support/users/techgnome/)
 * (@techgnome)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/hiding-post-bodys/#post-126570)
 * 6 of one, half-dozen of another. Potayto, potato. What ever boats your float.
 * In terms of optimization, it’s “Faster” using !. since that condition will execute
   more often than not, it doesn’t have to jump as far to execute the next line…
   since 1) were’ talking about micro milli seconds, 2) PHP is a scripted language–
   it proly doesn’t matter that much. It’s just my day job creaping in on me.
 * Tg
 *  [Nick Momrik](https://wordpress.org/support/users/mtdewvirus/)
 * (@mtdewvirus)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/hiding-post-bodys/#post-126571)
 * hehe…just giving you a hard time. 😉

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

The topic ‘Hiding Post bodys…’ is closed to new replies.

 * 7 replies
 * 3 participants
 * Last reply from: [Nick Momrik](https://wordpress.org/support/users/mtdewvirus/)
 * Last activity: [21 years, 4 months ago](https://wordpress.org/support/topic/hiding-post-bodys/#post-126571)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
