Category-x.php file one more time ;)
Treść tego wpisu jest dostępna również w języku polskim
There is also one more situation we can use category-x.php file. This file ‘gathers’ all posts assigned to x category and display them on one page after clicking on category x name. But what if we want to have regular page with some text and all post from category x below accessed via link in menu? No problem
.
We need to change two things in category-x file; we have to add title for this page and text (sorry, no possibility to add text as to regular pages ;). So open your category-x file and look for line <?php if (have_posts()) : while (have_posts()) : the_post(); ?>. Just above it we need to add <h2 class="title">Page title</h2> Class might be different. Look into your page.php file and check what class is assigned to its title. The same class you need to use for title in category-x file. If you want the title to look like any other it should be linked to this page. So it will look like that:
<h2 class="title"><a href="http://example.com/category/x/">Page title</a></h2>
( To find out URl for this category just click on category x name and copy URl from browser window )
Below title (but still above <?php if (have_posts()) : while (have_posts()) : the_post(); ?>) there will be some text. You need to paste for example:
<div class="entry">
<p>This is some text which will show up on top of page for category x. It can be as long as you need...;)</p>
</div>
We need to use class to make sure that text will look as on any other page. To find out its name check on page.php file. Look there for <?php the_content(); ?> and check out the name of class just above it.
OK. Page is ready. It will look like this (it may vary depending on theme you use):
Continue Reading »
25th October 2007 add your comment »
It drives me crazy when I need to search through few websites I’ve been working on to find the one with some solution I need again for other project. Thus I’ve made decision. I’m going to publish here all kind of tricks(?)/codes and so on I’ve used. That will serve two purposes:

. I’ve selected area 60 x 60 px so radius of my circle is 30 px.



