Josh (the blog)

I’ve delivered simple, clear and easy-to-use services for 20 years, for startups, scaleups and government. I write about the nerdy bits here.


@joahua

Search and display problem fixed

Dale was searching for some RSS stuff on this site, and discovered that he was only getting seven results (the same number as my default display for the front page) — and that the same problem existed with the month archive display. He thinks it used to work just fine, and I had thought it did, too, but I’m not really sure what I changed to break it. So, in a dodgy-ish patch, I’ve added next/previous page links to the bottom of each page. This works on search results, as well as monthly archives and the front page.

The code I’m using for these page links, just in case anyone’s interested, is as follow (obviously the CSS/formatting stuff is optional):

<p style="margin:10px;background:#D3D3D3;color:#404040;"><?php posts_nav_link(' ', __('<span style="float:left">&laquo; Previous Page</span>'), __('<span style="float:right">Next Page &raquo;</span>')); ?></p>

The essential PHP stuff only is:

<?php posts_nav_link(' ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>

Hope this makes life easier!

This is for the WordPress blogging system, and is used to add next and previous page links to the end of a document. Further information can be found on the WordPress wiki, on the article entitled “Template Tags“.