WordPress.org

Ready to get started?Download WordPress

Forums

Theme/Style methods changed? (24 posts)

  1. kyte
    Member
    Posted 9 years ago #

    I mean in the sense that with the beta 1, it now seems to be essential to provide header, footer, sidebar php files as part of the theme, whereas previously, the index.php was sufficient and pulled the header etc from the root directory...

    Is there a reason for the change? Have I missed something critical here? My basic themes break with beta1 on a clean install (perhaps they would have broken on the alphas too, with a clean install, but I don't think the change had occurred then...)

    Advice, please... I don't especially want to have to make two versions of my themes, and would prefer to continue using the KISS principle, which was one of the attracting features of WordPress.

  2. Ryan Boren
    WordPress Dev
    Posted 9 years ago #

    You don't have to use header, footer, etc. You can structure your theme however you want. All that is strictly required is a stylesheet and an index.

    All files must now live in a theme directory, however. WP no longer looks in the root for anything.

  3. Mark (podz)
    Support Maven
    Posted 9 years ago #

    The word I'm using tonight is interesting ... got some stuff working, others not, but it's not that it's difficult or worse, just different :)

  4. navid
    Member
    Posted 9 years ago #

    WordPress is right now in a snag -- the development pace and support is phenomenal (thanks to allusion and rboren) and as consequence, there are a lot more people using the nightly builds then people normally would... I guess the best part is that although the developers may feel overwhelmed, the general consensus is that early and frequent reports only creates a better and more stable product down the ways. I heart WordPress.

  5. Ryan Boren
    WordPress Dev
    Posted 9 years ago #

    I'll try to give a quick rundown of the recent changes to the default theme. These changes were motivated by a desire to eliminate the complexity of the include hierarchy for the default theme and avoid the upgrade collision problems.

    The default theme used to be comprised of files in the blog root and wp-content/. In the root we had index.php, wp-layout.css, wp-comments.php, wp-header.php, wp-footer.php, wp-sidebar.php, and wp-comments-popup.php. Certain files added to wp-content/ would also be used when constructing the default theme. The default theme required special casing in the theme engine since it lived in several different directories rather than within its own theme directory. Default theme files were also subject to overwrite during upgrade since they shipped with WP. To simplify matters, the default theme now lives in wp-content/themes/default. It no longer requires lots of special casing and trapsing through different directories.

    To avoid overwrite, a site theme is generated on-the-fly during install/upgrade. If you have old theme files from a previous release in your root, they are copied to a new theme that is named after your blog. A theme header is created and all files are updated to work as a theme. If you are doing a fresh install, the default theme is copied to your site theme directory. This allows you to edit your new site theme without worrying about overwrite during an upgrade. The default theme should not be edited.

  6. kyte
    Member
    Posted 9 years ago #

    Ok, thanks for that explanation, it was as I thought. I have decided to do the existing themes with 1.22 users in mind, and will also rewrite them for 1.5 (since they now break, where they didnt on the alpha, which was still pulling info from the main wp directory). I am assuming that the structures are unlikely to change in the near future so will construct new themes with that in mind.

    It does tend to make it a bit of a pain for those still using 1.22 though :-/

  7. trendsurfer
    Member
    Posted 9 years ago #

    I just downloaded the latest and like the way it's changing.......the only problem is the default theme was zipped up without its "images" directory.

  8. Ryan Boren
    WordPress Dev
    Posted 9 years ago #

    Yeah, SourceForge/CVS is giving me grief. Some of the stuff I committed last night seems to have disappeared. I just finished recommitting everything. Hopefully it will stick this time.

  9. Anonymous
    Member
    Posted 9 years ago #

    Let me get this straight: if 1.5 will no longer accept templates in the root, will I have to shift every page of mine that is using WP code into the theme directory? My understanding was always that the existing system would continue to work and nobody was going to be forced to use the theme system or rebuild their entire site. Has that changed or am I misreading this thread completely?

  10. Tek
    Member
    Posted 9 years ago #

    ?????????? I want to intergate gallery. So I was looking at this hoping it would explain what I need to do but I think I might be more confused.

  11. kyte
    Member
    Posted 9 years ago #

    Anon.. from rboren's explanation, it seems that the upgrade (assuming you do the upgrade thing) will move your theme, appropriately directoried, into the themes directory, and applied to your site. Ergo: no fuss upgrade. It worked for me:)

  12. kyte
    Member
    Posted 9 years ago #

    Tek... im sure someone will help, but my question was about the changes in how themes are read into one's site.

  13. Tek
    Member
    Posted 9 years ago #

    Well they are the same lines... I can't tell where the call for the theme is comming from so I don;t know how to edit the wrapper in gallery.

  14. kyte
    Member
    Posted 9 years ago #

    Welll... the index.php in the theme calls in the header, footer and sidebar, so if you dont want any elements of the index, I would think that you might want to edit that, to include your gallery (via a php include statement perhaps?).

    Alternatively you might edit your gallery's wrapper down to just the display elements and do a php include to get the header, footer and sidebar into that, and place a link via link manager to that page?

    Hope I've been of some help, I'm new to WP so... caveat emptor <grin>

  15. Mark (podz)
    Support Maven
    Posted 9 years ago #

    @Anon: I think both are true.
    From what I understand from playing with the latest stuff, yes, styles and such are moving to /themes
    and this is (for me at least) causing a couple of problems with static pages.
    BUT
    1 - The upgrade process will take care of all file moving so users have little to worry about
    2 - Further upgrades will be easier as those files that most of us customise will be in our /theme directory. As it is right now, upgrading involves taking a lot of care to stop WP overwriting our carefully altered files. This change helps us, not wp.
    3 - I will work later on the static page issues I have and post any useful information.
    4 - As it is right now, the difference between 1.2.2 files and a 1.3 theme are quite significant. This is to the detriment of all users and designers. This change makes things better for all users.

    Any changes that are essential will be 'one-off' jobs and good for a long time, so it's not a huge issue really. And in the end, if such a change is deemed to be too great by a user, then the answer is very very simple - do not upgrade.

  16. NuclearMoose
    Member
    Posted 9 years ago #

    This is to the detriment of all users and designers.

    Podz, are you sure about this?

  17. Mark (podz)
    Support Maven
    Posted 9 years ago #

    I meant it nicely :)

    I've been using the same way of styling my blog for almost a year. I played with themes when they first appeared, got confused, and left them alone.
    I have looked at various themes that have been published and still found them confusing.
    But now, WP will take what I have and effectively turn it into a theme, and even now I can see that because WP has done this I can better compare what I have with a 'theme' and start to explore how much more WP can do for me with regard to presenting my blog in different ways. For instance - I've not gone near the 'single' page display stuff - this change goes toward demystifying it. It also means that as I am now a 'theme' user, I can better support questions here about them as I understand the structure better.
    WP was carrying the legacy design from pre 1.0.1 so at some point, there had to be a change that offered a better upgrade experience yet also gave the user decent ways to change the look of their blog (the devs have changed a TON of code since 1.2 yet there is barely a murmur, they move the CSS and the noise arrives :) ).
    I do think that to leave an existing gap will be to the detriment of users - and support people. Let's get the design side of things into a state that pleases all - and before someone says that it may cost them a couple of hours to make their blog look nice again, just remember that it is free software, the support is free and if you value your blog, then you need to spend time on it. (That and the fact that upgrading is not an absolute necessity).

  18. Anonymous
    Member
    Posted 9 years ago #

    Wow. The upgrade routine will take all the template modules I've already made off my own bat (header.php, footer.php, archives.php, loop.php, links.php, etc.) and automatically convert them into a theme? My stylesheet too?

    Trouble is, I don't want them to be a theme, because not every page on my site uses WordPress and I want my header and footer includes available at the root. So am I going to have to stay with 1.22?

  19. Ryan Boren
    WordPress Dev
    Posted 9 years ago #

    The entire theming system can be short circuited by setting one variable. And in the end, an include is an include, php is php. You can include files from wherever you want to put them.

  20. villas
    Member
    Posted 9 years ago #

    ??? .. the lastes version of 1.5 dont work here in "localhost" (HD) instalation ???

    The themes dont load ???

    How i configure that ??? the links apoin to http://localhost/wp-content and the correct link is http://localhost/MyWP_dir/wp-content.

    Villas

  21. BenDG
    Member
    Posted 9 years ago #

    I love the way WP1.5 does themes. This is such an improvement over earlier versions! Kudos to the devs!!

  22. Mark (podz)
    Support Maven
    Posted 9 years ago #

    villas - that must be something configured locally. I have a couple of wp local installs, and both are working fine.

  23. villas
    Member
    Posted 9 years ago #

    Podz ... I have too... but since 01/01/2005 the files are diferent ... th wp-config.php is the same (wp-config-sample.php too) but the PATH dont work ... something in themes i think ...

    ????

  24. villas
    Member
    Posted 9 years ago #

    Nevermind ... solved !

    Thanks Podz !

    Villas

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.