Title: If/else help
Last modified: August 19, 2016

---

# If/else help

 *  [eightcrazy](https://wordpress.org/support/users/eightcrazy/)
 * (@eightcrazy)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/ifelse-help-1/)
 * I’m trying to put the php info for a plugin in my site. I have 2 full posts and
   then excerpts. I want it to appear under the full posts, but not the excerpts.
   So how would I do that using the if else statements?
 * here is what I have right now and it shows under full posts and excerpts:
 * <?php boposts_show(); ?>
 * the site is [http://www.nutritiouseats.com/](http://www.nutritiouseats.com/)

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/ifelse-help-1/#post-1737311)
 * how does the template file do the ‘2posts, then excerpt’ thingy?
 * simply follow this idea;
 * or paste the code of your template file into a [http://wordpress.pastebin.com/](http://wordpress.pastebin.com/)
   and post the link to it here.
 *  Thread Starter [eightcrazy](https://wordpress.org/support/users/eightcrazy/)
 * (@eightcrazy)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/ifelse-help-1/#post-1737344)
 * in the home.php
 * [http://wordpress.pastebin.com/M5MuEeyR](http://wordpress.pastebin.com/M5MuEeyR)
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/ifelse-help-1/#post-1737359)
 * change your line:
 * `<?php boposts_show(); ?>`
 * into this:
 * `<?php if( absint($loop_counter) <= 1 ) boposts_show(); ?>`
 * this is using the same condition, which controls if the full post is shown.
 * (btw: i coundn’t find where you had added yor line into the code of the template)
 *  Thread Starter [eightcrazy](https://wordpress.org/support/users/eightcrazy/)
 * (@eightcrazy)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/ifelse-help-1/#post-1737368)
 * I used a hook plugin.
 * I just added that into the hook, but it didn’t change anything. Should I try 
   adding it into the home.php ???
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/ifelse-help-1/#post-1737373)
 * it might still work with the modification, as `$loop_counter` is a global variable;
   
   maybe you need to expand the line to:
 * `<?php global $loop_counter; if( absint($loop_counter) <= 1 ) boposts_show();?
   >`
 *  Thread Starter [eightcrazy](https://wordpress.org/support/users/eightcrazy/)
 * (@eightcrazy)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/ifelse-help-1/#post-1737377)
 * THANK YOU! THANK YOU! THANK YOU!! that worked!!
 * there is one small glitch I see though. When you open a single post there is 
   a error warning in the bottom of the right sidebar
 * see here: [http://www.nutritiouseats.com/turkey-chili-2/](http://www.nutritiouseats.com/turkey-chili-2/)
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/ifelse-help-1/#post-1737378)
 * did you notice that error message before your last edits?
 * maybe the theme website’s support can help?

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

The topic ‘If/else help’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/ifelse-help-1/#post-1737378)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
