A Little Blog Debugging Session
Ξ June 7th, 2008 | → 0 Comments |
∇ Blog | ∇ Blog, Debug |
I was updating my blog. The expression update is used in the sense that my attention was focussed on design of the information provided by each click, not actually creating new posts. The basic result of design changes is always the same. Everything gets messed up and then follows a bug correction phase.
The latest problem was that my “Previous Entries” link wasn’t working. This was the first symptom, but the link was actually there and pointing to the correct location. My problem was that the selection of posts was always the last five entries.
Each page generated by Wordpress has an associated query that filters pages or posts based on the url you’re requesting. The problem was that by inserting a new “Recent Entries” section I’ve changed that default query to create the list of recent entries.
The solution was to create a personalized query to use in The Loop:
<?php $my_query = new WP_Query('showposts=10'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<!-- Generate the required list... -->
<?php endwhile; ?>







