[wp-hackers] Help Wanted with Code Snippet

Chris Coggburn Chris at Coggburn.us
Tue Aug 3 04:54:29 UTC 2004


Rubén Marrero wrote:

>
>
> 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'] 
> =='') {

actually that should be basename($_SERVER['PHP_SELF']) as far as I know, 
because php_self will return the full path.

>>  
>>
>> <?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.
>
>_______________________________________________
>hackers mailing list
>hackers at wordpress.org
>http://wordpress.org/mailman/listinfo/hackers_wordpress.org
>  
>


-- 
Chris Coggburn
http://noderat.com
http://chris.coggburn.us
http://beyonddigital.net




More information about the hackers mailing list