Instead of struggling with the “page” issue, why not use two categories for them with their own category_XX.php templates (where XX is the cat ID#) – and exclude these categories from other views.
Category_Templates
For excluding, see this: http://wordpress.org/support/topic/56529?replies=7#post-307098
Edit. P.S. Pages do not have categories.
Fantastic. Never realized it could all be that simple.
Thanks a bunch moshu π
Still, I seem to be unable to get it working…
Could someone be so kind as to give an example of how to define what category to be displayed in the category-1.php?
I am using a heavily modified Blix theme and it lacks a file named category.php. It does however have a file named archives.php
category-1.php will be used when someone is viewing the category id 1.
If you setup your categories and sub categories, you would have two links from somewhere. These would be the category archive views that would use the two templates defined as (category-x.php).
The category links would be drawn using a call to wp_list_cats
<?php
wp_list_cats(‘list=1&children=0&optioncount=0″);
?>
(probably in your sidebar, or navigation area) would product a link to your top two levels of category. These pages would use the template pages as above.
Ok. So I can’t point a link to just category-1.php? It seems however I code it, even making an exact copy of index.php, it says there is no input file.
I removed the sidebar from my site so theres no way of just “picking the category” except for right under the title for every post (I will remove the categories from there as soon as I get this working). Is there a way to get these two categories up in the navigation area in a simple way?
My testsite is up at http://www.slagzone.com/wordpress/
Thanks jaredquinn π
After quite some struggle I realized that what I needed was what you suggested, only <?php list_cats(); ?> instead.
I still don’t know the difference but I feel wiser.
1. Blix sucks when it comes about modifying…
2. WP is smart enough to pick up the proper category template when you click on a certain category’s link.
3. Saving the archive.php as category.php or catgeory_X.php is fine; just make the changes you need.
4. You should never link directly to template file!
5. The template tag you posted above is the default. Jared added some parameters to it.
1. Yes, Blix can be a b***h but I’ve been putting some two weeks into photoshopping what I want, CSS:ing it to look like I want and then adjusting it by asking guys like yourselves a bunch of dumb questions. So close now… Cant throw that time away π
2. Yeah. WordPress rocks π
3. Yeah, found out I didn’t need that though.
4. Learned the hard way π
5. Yeah. But his example killed my whole site. Not blaming his skills though, I probably mis-ctrl+v:ed it, so to say. why the prefix “wp_” though?
I got a new bag of problems now. Blix won’t recognize that I am in the category I used. It won’t show that button as being “active”. If I were to post some thirty lines of code here from Blix. You think you could find the error in my ways?
Rephrase:
Could I add something along the lines of “If category is #9 then make link active”?
I don’t think any of the themes (as far as I know) shows if a category link is “active” – if you mean being highlighted that you are viewing that category.
Re: 5. – because there are several template tags to display the categories: Template_Tags#Category_tags. (It’s always good to keep the Codex open in a window/tab when you work on your theme π
Long code is not welcome here, but you can always use http://pastebin.com and post the URL so people can take a look at your code.