[wp-hackers] Help Wanted with Code Snippet

BB bb at bbiverson.com
Tue Aug 3 07:17:32 UTC 2004


Here’s what I tried:

 

if ($_SERVER['PHP_SELF'] == 'index.php' && $_SERVER['QUERY_STRING'] =='') {

<?php previous_post('%', '<img
src="http://www.bbiverson.com/images/buttons/previous.jpg" alt="Read
Previous Entry" align="middle" />Previous Entry', 'no', 'no', 1, '') ?>

}else{

<?php previous_post('%', '<img
src="http://www.bbiverson.com/images/buttons/previous.jpg" alt="Read
Previous Entry" align="middle" />Previous Entry', 'no', 'no', 1, '') ?>
&nbsp;

<a href="<?php bloginfo('url'); ?>">Latest Entry</a> &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,''); ?>

<?php } ?>

}

 

I’m getting “Parse error: parse error, unexpected '}' in
/home/bbivers/public_html/journal/index.php on line 101”.  Line 101 is the
code in bold.

 

BB

 

  _____  

From: Rubén Marrero [mailto:ruben at lingo.com.mx] 
Sent: Tuesday, August 03, 2004 11:45 AM
To: hackers at wordpress.org
Subject: Re: [wp-hackers] Help Wanted with Code Snippet

 



BB wrote:



As referenced here <http://wordpress.org/support/3/9972> , I'm looking for a
way to put some post-to-post navigation at the top of my WP weblog pages.
(I'm set to 1 posts paged.)

 

Here is the code for my index.php file that I need help with:

 

If current page is index.php and nothing else after that address, then echo

if ($_SERVER['PHP_SELF'] == 'index.php' && $_SERVER['QUERY_STRING'] =='') {



 

<?php previous_post('%', '<img
src="http://www.bbiverson.com/images/buttons/previous.jpg" alt="Read
Previous Entry" align="middle" />Previous Entry', 'no', 'no', 1, '') ?>`

 

}else{



else echo

 

<?php previous_post('%', '<img
src="http://www.bbiverson.com/images/buttons/previous.jpg" alt="Read
Previous Entry" align="middle" />Previous Entry', 'no', 'no', 1, '') ?>
&nbsp;

<a href="<?php echo &#036;siteurl; ?>" title="Latest Entry">Latest Entry</a>
&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,''); ?>

<?php } ?>

 

}

Hvent's tried it, but I think it works

cheers.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/hackers_wordpress.org/attachments/20040803/8c9c686c/attachment.htm


More information about the hackers mailing list