![]() Eventually, this is coming to WordPress core and, for now, you can still take advantage of them using get_template_part. Templates. Generally speaking, I keep all of my custom templates in the root of the theme directory, but I’ve been keeping them in a templates subdirectory as of late.img. This should be self-explanatory, but all images that I use throughout a theme are kept in this directory.These include third-party scripts, classes, or other PHP-based files that may add functionality to the theme however, if I end up including, say, a jQuery plugin then that file would reside in a javascript/lib directory since it’s a JavaScript library. This is where I leave the PO and MO files for translators to localize the theme. I typically have two files – admin.js and theme.js – each of which are meant specifically for the dashboard and for the public-facing aspects of the theme. I keep all JavaScript dependencies in this directory. That is, they don’t necessarily belong in style.css. Include any third-party stylesheets or any styles that are outside of the theme core. Directories. I normally have five directories.Because of post formats, I also include the various loops for each format, as well as the README, changelog, and any attribute credits in the root of the theme directory. Files. All of the basic template files as mentioned in the Codex reside in the root directory.The truth is, I still do this but just in a slightly more elaborate manner which I’ll discuss in a bit. Prior to using CodeKit, I organized my files using the following schema. #Using codekit with wordpress how toTo that end, I’ll give a high-level overview of how to organize files without CodeKit and then cover how I actually organize my files when using CodeKit. Because I’m such a fan of this application and the benefits that it provides, some of my organization is based strictly around this application. Secondly, I’ve mentioned that I use CodeKit for all of my WordPress development. They define the foundation off of which all themes should be built. With that said, here’s how I organize my files when developing WordPress themes.Ī Word About WordPress, A Note About CodeKitīefore going too far into this, I highly recommend reading the Codex articles on Theme Development especially on Template Files. Simply put, theme file organization differs from plugin file organization. I recently shared how I organize my files when developing WordPress plugins, but since I also work with themes and have recently been building two applications using WordPress, I thought I’d also share my thoughts on organizing WordPress theme files.įor what it’s worth, I think that some developers – especially beginners – often try to make the plugin model fit the theme model or vice versa, and although both types of projects are aimed specifically at WordPress, they require different approaches. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |