Advertisement
Theme Development

Making a Theme With Bones: Cleaning Up

by

We will strip unnecessary parts from a fresh theme made with Bones.


Delete, Delete, Delete

Cleaning picture by inf3ktion, flickr
Cleaning / inf3ktion, flickr

The first two parts (Getting Started and Finishing Off) of the series about making a state of the art website with Bones. I'm working with that modified theme for this article. Bones is an excellent and very detailed starter theme.

I've been using Bones as a starting point for my projects and its absolutely thorough HTML5 code with the most comprehensive and highly detailed stylesheet I've ever seen.

But when the time is ready to put the final theme into production it is important to remove the parts that we don't need.

Bones grows every day. It's great for personal projects and clients alike. Download it, Customize it, and make it yours. It's a strong foundation for every project.

It's no secret there are a lot of PHP and other files that we should remove from the directories of our theme. For our purpose (no custom pages, translations, or taxonomies) this is a process that is preferable, but if you have other plans or needs, please act accordingly and consider these steps one by one.


Step 1: General Files in Root

Folder by XXC, flickr
Folder / XXC, flickr

We already have got a favicon set from another directory so this file should be deleted along with the readme and .gitignore file. The readme is the usual description file about the package. So delete these:

bones2/..
	README
	.gitignore
	favicon.ico

Step 2: Files in Library Root

Windows 7 folder by Wysz, flickr
Windows 7 folder / Wysz, flickr

Delete these, because we don't need styled admin pages or adding custom post types. The log.txt file is a report about the changes made through versions.

bones2/library/..
	admin.php
	custom-post-type.php
	log.txt

Step 3: Files for Custom Subpages

Picture by ewedistrict, flickr
Net / ewedistrict, flickr

We don't need custom version of the archive, single page, post page and taxonomy page, so delete these:

bones2/..
	archive-custom_type.php
	page-custom.php
	single-custom_type.php
	taxonomy-custom_cat.php

Step 4: Translation Files

Country flags by mdanys, flickr
Country flags / mdanys, flickr

By default, translation files are not enabled, so let's delete these as well:

bones2/library/translation/..
	de_DE.mo
	de_DE.po
	default.mo
	default.po
	es_ES.mo
	es_ES.po
	fr_FR.mo
	fr_FR.po
	he_IL.mo
	he_IL.po
	README
	translation.php
	zh_CN.mo
	zh_CN.po

Step 5: LESS or SCSS (SASS)

LESS and SASS CSS languages logos

These two languages have similar features and syntax but also have differences so it is important that you will use either LESS or SCSS and then you can delete the other one.


Step 6: Standard WordPress Pages

WordPress logo button by titanas, flickr
WordPress logo button / titanas, flickr

To opt for the standard WordPress look we can consider even deleting more files, like 404.php, archive.php or search.php.

Tip: For more speed you can create your own custom script (batch on Windows or bash on Mac or Linux) which will delete contents which are unnecessary.


Summary

This article was aimed only at a general overview about cleaning up a modified Bones theme like this. If you are not sure about one of the steps, then ask a developer or leave that part untouched (better safe than sorry!). Before you begin this deleting process, make sure you have a complete backup! Happy cleaning!

Related Posts
  • Code
    Creative Coding
    Advanced Use of Attachments in WordPress: Creating Custom Queries for AttachmentsAdvanced use of attachments in wordpress 400
    This tutorial is the second in a four part series in which you'll learn some techniques for working with images in attachments in WordPress which give you advanced options.Read More…
  • Code
    Creative Coding
    Advanced Use of Attachments in WordPress: Assigning Categories and Taxonomy Terms to AttachmentsAdvanced use of attachments in wordpress 400
    This tutorial is the first in a four part series in which you'll learn some techniques for working with images in attachments in WordPress which give you advanced options. Read More…
  • Code
    Theme Development
    Creating a WordPress Theme From Static HTML: Releasing Your ThemeCreating wordpress theme from html 400
    If you've been following this series you now have a working WordPress theme. Your theme has a number of template files, including a page template and an archive template, and also has featured image support.Read More…
  • Code
    Theme Development
    Creating a WordPress Theme from Static HTML: Creating an Archive TemplateCreating wordpress theme from html 400
    If you've been working your way through this series, you now have a functioning theme with two page templates. The steps I've demonstrated to this point are: preparing your markup for WordPress converting your HTML to PHP and splitting your file into template files editing the stylesheet and uploading your theme to WordPress adding a loop to your index file adding meta tags, the wp_head hook and the site title and description to your header file adding a navigation menu adding widget areas to the header and sidebar adding widget areas, a colophon and the wp_footer hook to the footer file creating template files for static pages. Read More…
  • Code
    Theme Development
    Creating a WordPress Theme from Static HTML - Creating a Page TemplateCreating wordpress theme from html 400
    So far in this series, I've shown you how to create a fully functioning WordPress theme from static HTML. We've covered the following steps: preparing your markup for WordPress converting your HTML to PHP and splitting your file into template files editing the stylesheet and uploading your theme to WordPress adding a loop to your index file adding meta tags, the wp_head hook and the site title and description to your header file adding a navigation menu adding widget areas to the header and sidebar adding widget areas, a colophon and the wp_footer hook to the footer file. At the moment, your theme only has one template file for displaying content—the index.php file. A powerful feature of WordPress is the ability to use template files for different kinds of content.Read More…
  • Code
    Creative Coding
    Creating a TextMate Bundle to Easily Package Your WordPress ProjectTextmate bundle 400
    If you've developed a WordPress theme or plugin, then you know how fast your codebase can grow in just a short amount of time. You start off with just a few PHP, JavaScript and CSS files. Then you find yourself creating image assets and adding them to your codebase together with their Photoshop file counterparts. After a while you'll be including other third-party PHP libraries as well. Then when you're finally ready to ship your WordPress project, you'll end up having a web of multiple file types like *.php, *.css, *.scss, *.js, *.min.js, *.png and *.psd, maybe you'll have some hidden files like .DS_Store. You would eventually need to clean your codebase up before zipping them all up for your users. Normally, this just means that you duplicate your files, then scan each and every directory deleting all the unwanted files. You'd then archive your project then perhaps use a third party app to remove the hidden files. This article will teach you on how to automate this packaging process by building a TextMate Bundle that would do everything for us with a single shortcut key. [tip]This article teaches about some tips regarding TextMate, an awesome code editor for Macs. You can find more information on TextMate from MacroMate's website[/tip]Read More…