“Recent Posts” module- which is the best method?
-
So I’m working on a creative way to show previous posts.
What I have right now is a link that shows the previous 5 posts in a DIV that pops up above the link when you hover over it. That part was easy enough.
Now what I want to do is enable the user to click “Previous” and “Next” within this div, so that without reloading the page, it will load another 5 previous posts.
I’m not sure which way to go on this. Any ideas?
Here is the relevant code.
CSS-
.drop ul { padding: 0px; margin: 0px; display:block; z-index:3; } .drop ul li { display: inline; width: 100%; list-style-type: none; font-family: Arial, Helvetica, sans-serif; height: 30px; position: relative } .drop ul li a { background-color: #FFFFFF; color: #FFFFFF; width: 100%; display: block; text-decoration: none; height:30px; } .drop ul li a:hover { background-color: #FFFFFF; } .drop ul li ul li a { color: #39F; } .drop ul li ul li a:hover { color: #30F; } .drop ul li ul { visibility: hidden; position: absolute; bottom: 10px; left:0; } .drop ul li:hover ul { visibility: visible; position: absolute; bottom: 10px; left:0; background-color:#FFF; width: 500px; height:100px; border:#000 thin solid; } .recent { width: 50px; height:100%; border-right:#000 thin solid; padding-right:10px; padding-left:10px; float:left; }
XHTML:
<div class="drop"> <ul> <li>Previous Posts <ul> <?php include (TEMPLATEPATH . "/recent.php"); ?> </ul> </li> </ul> </div> recent.php- <?php query_posts('showposts=4'); ?> <?php while (have_posts()) : the_post(); ?> <li> <div class="recent"> <?php the_title(); ?> </div> </li> <?php endwhile; ?>
I am aware that recent.php currently just shows 4 posts- it is that way for testing purposes, and because I’m not sure if the “offset” parameter or using the “paged” parameter would work better.
Can anyone help?
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘“Recent Posts” module- which is the best method?’ is closed to new replies.