• I have been reading the Codex about the use of creating a specific file for each category ID (i.e. ‘category-2.php’), and it seems that this is an easy way for me to break out the sections of my website. I want to be able to create a series of templates that arae categroy specific. I can do that no problem. However I have changed the BODY class in my CSS to display a single background image for the main page + main category section for the site. However say one of my categories is a ‘Photo’ section and I want to link from the home page to this category but the background will be reading the main CSS page. I am sure I can make a subclass or something, but wanted to make a header for each page. SOO.

    I dug up the ‘template-function-general.php’ file and saw the function for “get_header.” I copied it and made a new function called ‘function get_pheader’ and I am getting errors. I have a file there called ‘photo-header.php’ that the function calles, but it does not work. Here is the code

    Fatal error: Call to undefined function: get_pheader() in /Users/danmerk/Sites/wordpress/wp-content/themes/default/category-2.php on line 1

Viewing 2 replies - 1 through 2 (of 2 total)
  • In what file did you define your get_pheader() function ?

    I don’t think you don’t need to dig around in the functions.

    You can make a header for each page, and call it header-2.php, to keep with your example.

    Then in your category-2.php file at the top put:
    <?php load_template( TEMPLATEPATH . ‘/header-2.php’); ?>

    You can also have a special css, category-2.css, and call that css in the header-2.php instead of the normal css import.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Different Category template pages’ is closed to new replies.