Support » Themes and Templates » Theme vs Templates – Some basic help please

  • I used WP 1.2 for a long time, and had a template switcher with 5 or 6 of some great pre-made templates that were available. The content, and the sidebar content were independent of the templates, and it made sense that you could choose a different template, yielding a completely new look and same content, but required no editing.

    In WP 1.5, themes have come into play. While I’m very adept at php/html, I’ve had to learn CSS and have a pretty good grasp of what’s going on (with some help from some fine folks here, thanks!).

    My question/issue is this: I’ve created a theme called “mine”, which is essentially a copy of root’s Trident. I’ve edited the sidebar menus to reflect the content they should, etc, but those edits are in the \themes\mine directory. Am I missing something, or in order to implement a “theme switcher”, wouldn’t I have to go into each and every theme I wanted to make available and edit the content to reflect what I want in the sidebar, etc? I’m certainly not complaining, however, it didn’t used to be this way, and while I’m learning LOADS about CSS and having a blast, I’m a bit confused as to how WP 1.5 themes make it easier, or allows “theme switching” without some serious editing of each theme you’d want to allow? Maybe they don’t, or maybe I’m just missing a rudimentary piece of why we’re using themes now, but I’m confused nonetheless.

    I don’t want to waste anyone’s time, and I’ve read the differences, etc, but if someone could explain I’d sure appreciate it. I feel like I’m missing something here.

    Thanks loads,

Viewing 9 replies - 1 through 9 (of 9 total)
  • Have you seen this page on Codex yet?

    Thanks for the quick response! Yes, I nearly committed it to memory I’ve read it so many times, but it doesn’t clear up for me. I must just be fated to “not getting it”, because no matter how I slice it, I come up with me having to edit and/or actually create sidebar content for any theme I’d want make available. The following statement from the above link is the most confusing to me:

    “Second, it allows users with appropriate permissions to quickly change the layout of the entire site by uploading a new theme and flipping a switch in the admin panel. “

    See, I can’t do that…effectively anyhow, and without losing my sidebar content. I’ve modified my “mine” theme to do what I want it to do. I’ve also got 8 or so other themes available, and can select them at any time in the admin panel. However, the only thing that comes over is the DB info (posts). Everything else (sidebar content which used to be in the single “index.php” for the whole site) is still in the localized \mine folder for obvious reasons.

    So, again, I’m left wondering how the above statement makes any sense unless you have absolutely nothing but posts on your blog. I’m probably missing something, but my question/issue boils down to this:

    With the WP 1.2 “single index.php” model, my sidebar content was available to all the templates, and the above statement about “flipping a theme on” held true, and all the content would show up per those settings. With WP 1.5, it seems that all that content is now specific to a theme, making that “just flip on a theme and volia” statement above just not work for me.

    I’m truly not an idiot, I am just having a real hard time understanding the concept. If I could just wrap my head around the concept of “flipping on a theme and having it work” in 1.5, I’d be content. Because I can’t just go “turn on another theme” without losing all my sidebar content, I’m thinking I’m doing something wrong, going in the wrong direction, or painting myself into a corner.

    Any enlightenment would be appreciated eternally!

    Thanks all,

    Thanks for your patience. I think that your post will go a long way in providing the documentation team some things to think about. Perhaps there are ways that information can be improved/expanded upon to help you and future visitors. I will be sending the docs-list a link to this thread. Meanwhile, I’ll see what I can do about finding some more information for you.

    EDIT: How about this?

    Oh, now I understand. You want each “theme” to look the way YOU want it to look, independent of the theme designer’s intend. So you’ve customized the sidebar, per example, and you want “that” information to be the same every time you switch themes – only the look changes.

    Sorry, tough, you are out of luck.

    Well, not totally. If you change, for instance, your sidebar to KEEP the same class and div identifiers as everything else, and add special links like custom posts or set the Pages or Categories template tags to not show children and things like that, but the core references are the same, you can copy your sidebar.php to whatever theme you want to us or switch to and as long as the divs and classes are the same, the new info will show up.

    Is this what you are asking?

    See, every “Theme” comes with it’s own blocks to play with. It’s like having a child come over to play with their own toys. Now, you may have some blocks that are your favorite, and if they are the same size and shape so they “fit” the rest of the blocks, then you can add yours and build some interesting things. But if you are trying to connect Legos with Lincoln Logs – you might get a building but it will be “different”.

    Get it?

    I hope I can at least try and help a little. All I can say is that once you do get your head around it it is awesome . And simple. And intuitive. But folks who havent or can’t grasp it shouldnt feel guilty. It is not easy to explain. I think the codex does a fine job but as NM intimated some folks are struggling.
    But themes do make your life a lot easier once you get started. I think in layers. The core layer if you like is a complete set of files. The template layer is a series of edited index fils (and home files). The style layer is CSS only. In that context – a lot of unrelated separate themes do not help the guy just getting started to understand how it works. But you will do. I promise. I hope Odyssey will make it a lot easier for everybody. That is certainly my goal.

    Andrea Rennick


    Customer Care at Copyblogger Media and Studiopress

    (Hey, I asked a variation of this question yesterday. 🙂 )

    I think what you had before was the style swticher, which just switched what stylesheet the same index page looked at. In that respect, having the same content across all styles (or templates as you called them) was a little easier to understand.

    Once you do get into Themes, they are really fun. What I do is make up my own (or rearrange an existing one so I can understand it), so when I make a new theme for myself, all my sidebar stuff is there, and I just copy the same sidebar file over into the new theme. And yes, I use the same CSS identifiers as Lorelle mentioned.

    You can keep your sidebar content by switching themes, but as Lorelle points out all you be required to do is duplicate the sidebar and add the relevant CSS for each theme. With 1.2 it was a case of just changing the stylesheet, which is why you probably kept your sidebar. The flexibility of the new approach is that you can either have the same content or different content in the sidebar. The addition of all this extra stuff can seem overwhelming at first, but it also opens new options for you in terms of how you present your content.

    I have a feeling once you get a grasp of it, you will really appreciate the intelligence of the design. For an example, look at the theme switcher by ryan, and it’s demonstration on The same content on all 70+ themes, but all presented differently dependent upon the theme, some don’t even have a sidebar and the core content remains; those with sidebars demonstrate the same content but present it differently – you can shift the importance of certain items for a particular theme for example.

    Take it slowly and try to take it a step at a time, once you’ve absorbed some of it and played aorund with the idea it will really be quite refreshing. Alternatively I know some that have stuck everything in one php file. I see more disadvantages than advantages in this and though it is extra work in production and management, the result is much more satisifying and, as I say, flexible.

    my 2 c

    The OP has even greater difficulties getting the idea of “switching themes” since is using a 3 columns template. Thus his
    <div id="rmenu"> doesn’t have any correspondent in the default or classic – those being 2 columns templates. Also while his <div id="rmenu"> is floated right, his <div id="menu"> is floated left – contrary to what you’d find in the other (usual) templates.

    To be honest I also had a lot of difficulties grasping how the “templates” work together with “themes” (or the other way around if you wish:).
    If a theme has the minimum number of files required (see here and further down) it will use its own template – i.e. in my understanding its own layout, index file structure.
    Somebody invented the term “parasite themes” – meaning style.css and eventually bg images that use another existing template. For example many 1.5 “themes” that were converted from 1.2 styles basically use the classic template. This has to be stated in the header of the style.css file.

    Now the OP can use or create additional themes for his 3 columns blog, but in order to be able to do that he has 2 choices:
    a) tell the themes to use his “mine” template
    b) use other 3 column templates that have identical markup for rmenu, menu etc.

    But maybe I am wrong…

    That seems spot on moshu. The obvious q about any *CSS only* theme is *what template does it need* ? And 3 cols bring their own issues as moshu points out. I have bent Trident every which way so that one template could drive all my layouts but it does not seem possible. You can split the menus but the clearer divs get in the way when you return to 2 cols.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Theme vs Templates – Some basic help please’ is closed to new replies.