Code is Poetry
And it can also be frustrating. I have been coding up a website for a friend and I was testing the blog component for scale. I have allowed for a user-defined maximum of posts visible on a page. I have code that allows a user to scroll through prior posts.
I started the test case thinking that it would take just a few minutes. I added about 40 posts to ensure that the scrolling would work. However, I kept getting the same ten posts over and over. The previous and next links would show as expected but the posts would not change.
I spent almost ten hours debugging this particular function. The solution, buried deeply in one of the WordPress forums, was obvious:
<?php {$paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;Â query_posts(“cat=1&paged=$paged”); } ?>
Code is poetry. It works now. I can take some time off to celebrate my birthday.
Happy Birthday, Richard!
If I was there, I would do a rendition of your choice on my violin.
Trevor
Thanks Trevor!
While a bit late, Happy Birthday, Richard! Hope you had an enjoyable day/evening! Rob