WordPress.org

Ready to get started?Download WordPress

Forums

WP as CMS: Multiple templates for single.php? (1 post)

  1. websta
    Member
    Posted 6 years ago #

    Greetings! Firstly, I want to thank everyone who has contributed to WordPress' development. Not being a PHP expert by any means, I struggled for weeks with Joomla -- never getting it to work as I hoped. Yet I was able to replicate all I had accomplished with WordPress in only a day or so. Bravo, God bless you, my sincere thanks, & the next round is on me!

    Background: I am re-designing the default theme in WP 2.2 as a CMS for a new learning archive site. It has 9 primary categories (e.g., Math, Science, etc.) and over 200 (sub-)categories (e.g., Addition, Algebra, etc.).

    To aid in navigation (especially since users will include very young children), each primary category has its own, color-coordinated, header.php and sidebar.php. Consequently, I have 9 header.php files and 9 sidebar.php files. Site thus far is available at: http://www.growandknow.com .

    Based on this post ("using as cms: page or post?"), I have decided that we will need a few static Pages (home page, About Us, etc.), but the bulk of the content will be Posts, due to the need of the categories (at least, I think that is the proper decision... any thoughts?).

    Question: So now, a problem arises with the single-post pages... I would like single.php to include the sidebar and for single.php to instead divert to the proper category's template -- that is, so a single post page would display the appropriate header and sidebar from one of the eight primary categories.

    It wasn't too difficult to figure out how to divert users to 1-of-the-9 category.php files, but I have no clue on where/how the single.php files are called for, and how to tie the various category themes to single.php.

    Please help? Such as it is worth, my undying gratitude will be yours.

Topic Closed

This topic has been closed to new replies.

About this Topic