0
votes

I am very news in WordPress world and I am finding some difficulties with creation of a personal template.

I want implement a blog like this one (that is do using WordPress): http://viralpatel.net/blogs/

My blog have to be simplest and there must be only two coluns: one for the last posts and one for the more visited post

So I am started from an existing template (named Coogee) and I have divided the content area (the index.php file) into two columns: the first one that show the new posts and the second one that show the most read posts.

I have implement this features with some lines of code that I have put in my columns as show here: http://bacsoftwareconsulting.com/blog/index.php/wordpress-cat/how-to-display-most-viewed-posts-in-wordpress-without-a-plugin/

Ok, now the homepage look good for my intents but I am having some problem in the categories page.

For example if you click on the "generic" link on Categorie menĂ¹ in the side bare you obtain this page: http://scorejava.com/wordpress351/?cat=2

In teory this page have to show ONLY the articles that have "generic" as setted category but this is not true, infact in the left column are correctly showed the articles having "generic" category setted but in the right column still remain the last 5 posted articles...

And now I have a question...seems that WordPress use this index.php file as template of the content area of all page (except the one that displays a single article that uses **single.php file)

This is not good for me because I want that a category page show only one big column with the last articles of the current category, as here: http://viralpatel.net/blogs/category/spring/spring3-mvc-framework/

As you can see in this blog there is more columns in the homepage but only one column for the category page

I would know if:

  1. **Exist a way to define an other structure (different from the index.php file used for the homepage articles content) for the catecories page?

  2. If I can't use an other structure for the categories page and consequently I have to use the same index.php file also per the categories content page....there is a way to show the second column only if the visitor is in the homepage and don't show it if he is in a category page (do not show it if the visitor is in a pge like: http://scorejava.com/wordpress351/?cat=2

Or do you have some other solutions?

Tnx

Andrea

1

1 Answers

1
votes

If wordpress code cannot find a category.php then it will use the index.php file. index.php is like the fallback file.

The hierarchy structure for the categories go like

1> category-slug.php (Note: available with Version 2.9)
2> category-ID.php
3> category.php
4> archive.php
5> index.php 

That is, if you do not have a category-slug.php (lets say category-news.php), WordPress will check for a category-ID.php (like category-6.php), and so on.

So i would suggest you create a category-slug.php file (where slug will be your category's slug).

for more info check out this link. http://codex.wordpress.org/Category_Templates