previous post in the same page (not a real hack bu
-
well, as you know wordpress generates an id for each post.. this could be simply used to create a nice and small hack to jump to the previous post in the same page using anchors..
go into the wordpress loop, and place this code where you want it to appear (eg. next to the date or between the post footer items..)
<pre>
// place it at the top of the wp loop
// better just before the post title
// (you should have it, anyway..)
“>
// calculates previous post id
// by subtracting 1 unit
// and gives it to the $next variable
<?php
$next=$id-1;
?>
// generates a link
// to the previous post anchor
” title=”go previous post”>prev
</pre>
an example could be seen at https://gat.blogo.net
enjoy..
- The topic ‘previous post in the same page (not a real hack bu’ is closed to new replies.