• Hi

    I would like to make category.php so when the user clicks a link to a category from the index page it will take them to the right category.

    I have looked at the codex and list_cats is not what I want I would like the viewer to be able to see all the posts in that particular cateogry only.

    On my index page there is a link to politics so when the user clicks on it they will be taken to category.php with a list of all the posts in politics.

    I do not want to have to hand code all the categories as I may be adding more and it is better to have it relate to the links displayed in my sidebar.

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Okay, I might not be understanding, but if you click a specific category, you are taken to a page by default that shows off all the posts within that category and its children. It might be the category children that are messing you up, but they will show because they are part of the parent category. If you click on a child category name, the parent categories dissappear.

    If you would like to have custom information available like an introduction or list of other categories or related topics on your category web pages, you can use the category templates article from the Codex that will take you step-by-step through the process. If you want to see them in action, check out my custom category pages here.

    Thread Starter music_man

    (@music_man)

    Thanks

    Say you click on “politics” from the sidebar, you will be taken to “category.php” which lists all the posts from “politics” only.

    Thread Starter music_man

    (@music_man)

    bump

    if the category is y, then it should take you to the archives of that cat by default i believe. all entries under x display as x number of entries under cat y.

    i guess that’s what you mean. do you have an archives.php file? what theme? Where’s your site etc etc

    Thread Starter music_man

    (@music_man)

    Hi

    http://www.debate.co.nz

    I am not sure if it is for archives. Say I make a new category and write a post for it – that would create a link in the sidebar – that link in the sidebar would go to my category.php file which would list that post only (as it is the only post in that category).

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘link to category from header’ is closed to new replies.