Category template customization

January 11th, 2008

Daily Photo

Daily photo is one of my categories from my previous design, and had been set up to not display on the main page when a post in this category was made. The idea behind excluding this was to keep frequent photo posts from clogging up the front page. I tried a couple of plugins, but they conflicted with other previously established functions. See plugin Conflicts

So instead I found a nice little snippet of php which you paste directly underneath.

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

and it is here if you need it.

<?php if ( !(in_category('15') && is_home()) ) { ?>

A little further down the page if still intact you will find.

<?php endwhile; else: ?>

just above add this.

<?php }; ?>

Surprisingly simple it just says if its category 15, (which is my daily picture category) and if it is home exclude it. Job done.

That is all well and good, but my previous design had my photo posts fitted into the old design were they where restricted in size by the page dimensions, sidebar etc.

I needed a new template for photo specific posts, that would allow me to show the pictures in a larger format.

I had learned that I could create a duplicate template from category php, or if you don’t have that in your theme archive php. Just copy said file and rename it with the id of the category you would like to customize.

ie. Rename the template you want to customize to.

category-15.php

The - and the number representing the id of the category you wish to manipulate.
This works well enough when categories are viewed from category link, and you will see your customization.
However, when viewed directly from post link the post will go to it’s default setting.
What I needed was ‘a display post on specific page’ plugin and after looking far and wide found this nice little number.

Force Category Template

I read the description, looking good, read the comments, some users seem confused, I was inspired by the general look of the site design and decided to use the plugin. Installed etc, went through normal plugin CHEKIN protocol, and found no reference, or how to configure it to do it’s job. A little bemused I clicked the direct link to my photo and apprehension was resolved, as I realized the solution was complete as it was.
Very nice job, What can I say.. Excellent. Cheers.

Update

I haven’t yet altered the styles of photo pages, but rest assured bigger pics are on the way. Goodnight.

Entry Filed under: WordPress

1 Comment Add your own

1.
wordpress: Different side&hellip  |  January 26th, 2008 at 8:58 pm

[...] posts Category template customization Template plan: design your own [...]

Leave a Comment

Required

Required, hidden



Trackback this post  |  Subscribe to the comments via RSS Feed