• Resolved sirthaddeus

    (@sirthaddeus)


    I am wanting to put different headers above the post in my category pages.

    I created a new page called “category-3.php”

    How do I incorporate the post that will are in a certain category to display only on this category page?

    Thanks in advance!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Well, if you created category-X.php – WP will know exactly when to use it: when displaying posts from category #X. No need for your intervention.

    As for different headers, you can create a file header3.php and replace get_header at the top of your category template with this line:
    <?php include (TEMPLATEPATH . '/header3.php.php'); ?>

    Thread Starter sirthaddeus

    (@sirthaddeus)

    I created created a category-3.php page that is suppose to reference my category that has the url of http://www.mydomain.com/blog/?cat=3

    Is that what you mean it will know when to use it or did I do something wrong?

    1. That is NOT a “page”. It is a template file that should be placed in the theme directory. If it is there and done correctly, WP should use it. How do you know it is not using it.
    2. How did you create/made that template file?
    see Category_Templates.

    Thread Starter sirthaddeus

    (@sirthaddeus)

    Because I type in the url to the category-3.php and it just references my whole blog and not the category page.

    I created teh template file (category-3.php) by copying archive.php since I had no category.php page as stated on the link you provided.

    How would I link that template file that wp creates for my category to my created category-3.php file?

    Because I type in the url to the category-3.php

    You should never ever do that!
    No template file should be typed in the URL.
    The template file will be used when you go to example.com/?cat=3

    Thread Starter sirthaddeus

    (@sirthaddeus)

    I thank you moshu for your help.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘category pages’ is closed to new replies.