Title: Coder help needed
Last modified: August 18, 2016

---

# Coder help needed

 *  [pezastic](https://wordpress.org/support/users/pezastic/)
 * (@pezastic)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/coder-help-needed/)
 * I’m trying to figure out a global post-to-post navigational scheme and I haven’t
   a clue what I’m doing. I need help with a code snippet. I have it right below
   the content div in my index.php file. I’m getting a parse error, unexpected on
   the last ‘}’:
    ` if (basename(__FILE__) == 'index.php' && $_SERVER['QUERY_STRING']
   =='') { previous_post('%','<img src="http://www.bbiverson.com/images/buttons/
   previous.jpg" alt="Read Previous Entry" align="middle" />Previous Entry', 'no','
   no', 1, '') } else { previous_post('%','<img src="http://www.bbiverson.com/images/
   buttons/previous.jpg" alt="Read Previous Entry" align="middle" />Previous Entry','
   no', 'no', 1, '') &nbsp; ?> [">Latest Entry](https://wordpress.org/support/topic/coder-help-needed/"<?php)&
   nbsp; <?php next_post('%','Next Entry<img src="http://www.bbiverson.com/images/
   buttons/next.jpg" alt="Read Next Entry" align="middle" />','no','no',1,''); }
   Can someone help me?

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

 *  [ringmaster](https://wordpress.org/support/users/ringmaster/)
 * (@ringmaster)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/coder-help-needed/#post-79453)
 * What are those ” amp;nbsp;”s meant to be? The forum has mangled your code somewhat.
   
   And your error is “Unexpected }”?
 *  [Cypher](https://wordpress.org/support/users/cypher/)
 * (@cypher)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/coder-help-needed/#post-79467)
 * It looks like you’re missing a closing paranthesis for your primary IF statement.
   So put a close ‘)’ after ‘$_SERVER[‘QUERY_STRING’] ==”)’ and see if your error
   goes away.
    Regards
 *  [Root](https://wordpress.org/support/users/root/)
 * (@root)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/coder-help-needed/#post-79588)
 * You wanted what ?
 *  Thread Starter [pezastic](https://wordpress.org/support/users/pezastic/)
 * (@pezastic)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/coder-help-needed/#post-79590)
 * The previous, latest, and next links were running together, so I put in a couple
   non-breaking spaces. Anyway, they aren’t the problem. I don’t know what is, but
   they aren’t. 🙂
 *  [Cypher](https://wordpress.org/support/users/cypher/)
 * (@cypher)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/coder-help-needed/#post-79616)
 * Actually, what I meant was:
    if (basename(__FILE__) == ‘index.php’) && ($_SERVER[‘
   QUERY_STRING’]) == ”)) { Notice the ‘)’ after the first check. With this code
   I don’t get any errors. Regards
 *  [Cypher](https://wordpress.org/support/users/cypher/)
 * (@cypher)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/coder-help-needed/#post-79691)
 * Send me an email and I’ll help you through this.
    Regards
 *  [Scott Reilly](https://wordpress.org/support/users/coffee2code/)
 * (@coffee2code)
 * WordPress & Plugin Developer
 * [21 years, 10 months ago](https://wordpress.org/support/topic/coder-help-needed/#post-79692)
 * To my eye it looks like the parentheses are unbalanced for the if()’s conditions.
   Perhaps try:
    `if ((basename (__FILE__) == 'index.php')` && `($_SERVER['QUERY_STRING']
   == '')) {` I haven’t look at this any deeper than that.
 *  Thread Starter [pezastic](https://wordpress.org/support/users/pezastic/)
 * (@pezastic)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/coder-help-needed/#post-79694)
 * Nope that didn’t solve the error problem, either. 🙁
 *  [Scott Reilly](https://wordpress.org/support/users/coffee2code/)
 * (@coffee2code)
 * WordPress & Plugin Developer
 * [21 years, 10 months ago](https://wordpress.org/support/topic/coder-help-needed/#post-79695)
 * Do you close out the php tag at the end of your snippet, like so:
    `<?php next_post('%','
   Next Entry<img src="http://www.bbiverson.com/images/buttons/next.jpg" alt="Read
   Next Entry" align="middle" />','no','no',1,''); } ?>
 *  Thread Starter [pezastic](https://wordpress.org/support/users/pezastic/)
 * (@pezastic)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/coder-help-needed/#post-79703)
 * That worked wonderfully! You’re a godsend.

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

The topic ‘Coder help needed’ is closed to new replies.

 * 10 replies
 * 5 participants
 * Last reply from: [pezastic](https://wordpress.org/support/users/pezastic/)
 * Last activity: [21 years, 10 months ago](https://wordpress.org/support/topic/coder-help-needed/#post-79703)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
