Showing multiple pages of entries in 3K2
Apr 16th, 2007 @ 09:28As you may or may not know, I recently switched to the 3K2 theme on this blog.
I'm very happy with it, but something kept irritating me. In the search results, you can't browse back to see entries prior to the 10 results listed on page one. The same things happens, when you're viewing a certain category/tag. Basically: The "previous entries" and "next entries" are missing at the bottom.
I found out, that this relates to the "rolling archives" feature, that deploys a vertical scrolling bar where you can flip through the pages. This bar doesn't show up in search results or in category pages. But I like the rolling archives feature, so I want both. But how?
Simple:
In your WordPress admin section go to Presentation –> Theme Editor –> theloop.php
Find the following (it's near the bottom of the file):
<?php /* Insert Paged Navigation */ if (!is_single() && get_option('k2rollingarchives') != 1) { include (TEMPLATEPATH.'/navigation.php'); } ?>
This tells WordPress to show "navigation.php" (which holds the "previous entires" and "next entires" links) to be displayed IF you're NOT looking at a single page/post AND the "k2rollingarchives" isn't set — that's what "!= 1" means. "!=" 1 basically means "different from one" - aka "not set" in PHP language.
So, just delete the following and you're set to go:
&& get_option('k2rollingarchives') != 1
Now you have the rolling archives at you front page AND the links at the bottom to previous and next entries. With this on you also ensure that Opera Mini users can view your site :-)
Related postsTags: About this blog, CMS, PHP, wordpress