The Options For WordPress Theme Development

305

At the recent WordCamp Edinburgh, I took part in a panel discussion about WordPress theme development and the options available to developers when building themes. The overriding conclusion from the session was that there isn’t a one-size-fits-all answer and that the best method depends on the needs of the website and the capabilities of the developer.

But if you’re starting out building WordPress themes or want to develop a system for building them more efficiently or robustly, how do you decide which approach to take? In this article, we’ll briefly describe how WordPress themes work and then look at some of the different approaches to developing them, with tips on which approach might be most suitable for your website and circumstances.

How Does A WordPress Theme Work?

In WordPress, themes drive a website and determine what it contains, how it behaves and what it looks like. The theme is separate from the content, which is held in the database. This means you can use the same theme on more than one website, regardless of the content of the websites — which you might already be doing if you’ve downloaded themes from WordPress’ theme repository.

 

What To Consider When Developing A WordPress Theme?

Before deciding which approach to take to develop your theme, identify your constraints. These likely include the following:

  • Time
    How much time do you have to develop your theme, or to learn how to do it?
  • Budget
    This is related to time but also has to do with whether you can afford to pay for a premium theme or a theme framework.
  • Capability
    How familiar are you with theme development, with CSS and PHP and with how themes work? If you’re not familiar, how much do you want to learn?
  • Future-proofing
    Will your theme need to be updated in future? Will other developers be working on it in addition to you? If so, then your approach will need to be as robust as possible.
  • Repetition
    Do you see yourself developing a number of similar themes in future? If so, your approach will have to allow for code to be reused.

We’ll revisit these considerations at the end of the article and identify which development options are most suitable for various situations.

Theme Development: Your Options

A few options are available for developing your theme or themes, and investigating them before you roll your sleeves up and start coding would be worthwhile. Picking the right approach will result in a better theme, with more robust code, and it will minimize the amount of revisions you’ll have to do later. It will also help you to build the theme more efficiently.

The options we’ll look at here are:

  • Build a theme from scratch,
  • Edit (or “hack,” some might say) an existing theme,
  • Use the theme customizer to tweak an existing theme,
  • Create a child theme to make changes to an existing theme,
  • Create your own parent theme (using one of the approaches above) and child themes,
  • Use a theme framework.

1. BUILD A THEME FROM SCRATCH

This approach is the most difficult if you’re inexperienced. But if you’re a seasoned WordPress developer, it will give you the most control. It might be the most appropriate method if you’re importing HTML from an existing static website that is being upgraded to WordPress with no other changes.

However, when transferring a website to WordPress, conducting a review of it as part of the process, rather than simply copying the code across, is a good idea. If you are copying a static website, you’ll need to keep a close eye on your code to ensure that it’s clean, efficient and valid.

2. EDIT (OR HACK) AN EXISTING THEME

This is how most people start with WordPress theme development: in working on a theme that they’ve downloaded, they see that some styling isn’t quite right, so they delve into the style sheet and make some edits. Starting like this is tempting because it feels like a quick and easy way to achieve the effect you want. But there are some dangers:

  • If you ever switch themes, that update will override any changes you’ve made.
  • It’s easy to add repetitive code by adding new styles lower down in the style sheet that override styles higher up, rather than removing what you don’t need.
  • The website could end up with a lot more code than it needs.
  • If the theme isn’t well coded or commented to begin with, you could get yourself into a bigger mess and find that you have to make a lot of fixes.

However, hacking a theme can work if you go into it with your eyes open. It may be an option if the following are true:

  • The theme you’re using is well written, valid and commented (e.g., the default WP theme, Twenty Eleven);
  • The changes you’re making are so drastic that you wouldn’t need to update the original theme;
  • You understand the PHP and CSS contained in the theme and are comfortable editing, adding to and removing it without breaking the theme.

If you do decide to go down this route, keeping a backup of the original theme and commenting your code thoroughly are important. I would also advise commenting out any code that you don’t want and then testing to see what happens before deleting anything.

3. USE THE THEME CUSTOMIZER TO TWEAK AN EXISTING THEME

The theme customizer was released with WordPress 3.4. It gives you the option to customize a theme without writing any code, simply by using a WYSIWYG interface. Depending on how well the customizer is written into the theme itself, you can use it to change images, titles, colors and even the layout. Expect to see more themes with the customizer integrated into them.

Using the WordPress theme customizer with the Twenty Ten theme.
Using the WordPress theme customizer with the Twenty Ten theme.

The theme customizer stores your changes in a separate file, not in the theme’s style sheet, so there will be repetitive code.

For more information, take a look at Otto on WordPress’ video tutorial or guide to integrating the theme customizer into your own themes.

4. CREATE A CHILD THEME TO MAKE CHANGES TO AN EXISTING THEME

This approach is similar to editing an existing theme, but safer. It consists of creating a brand new theme that is defined as a child of the existing theme. Where your child theme doesn’t have a particular file but the parent theme does, it will use that. Where the child theme does have a file, that file will override the equivalent in the parent. This line tells the browser to load the parent theme’s style sheet before rendering any of the styles in the current style sheet. This frees you from having to duplicate any styles in the parent theme that you want to use.

So, that’s how child themes work. But when is this the best approach? I would suggest using it in the following cases:

  • You already have a theme (to be used as the parent) that contains most of what you need for your theme;
  • You want to be able to update your parent theme (for example, when theme updates are released following a WordPress update);
  • You don’t want to get tied up in knots from hacking an existing theme;
  • You want the option to revert to the parent theme or to develop another similar theme in future (which would be a new child theme);
  • You’re developing a number of similar websites with some minor stylistic or content differences (I did this when building similar websites for a client that owned multiple companies);
  • The difference between your child and parent themes is not so huge that you need to start from scratch, or not so huge that your child theme’s code will override anything affected by updates to the parent theme.

 

from : http://www.smashingmagazine.com/2013/03/13/a-guide-to-wordpress-theme-options/

[quote font=”verdana” font_size=”14″ font_style=”italic” color=”#474747″ bgcolor=”#F5F5F5″ bcolor=”#dd9933″ arrow=”yes” align=”centre”]This Demo Content Brought to you by Momizat Team [/quote]

this is tags and keywords : wordpress themes momizat Tutorial wordpress templates

Compartilhar.

Autor

305 Comentários

  1. Thank you for the good writeup. It in fact used to be a leisure account it. Look complex to far added agreeable from you! By the way, how could we keep up a correspondence?|

  2. After study just a few of the blog posts on your website now, and I actually like your way of blogging. I bookmarked it to my bookmark web site record and can be checking again soon. Pls take a look at my web page as effectively and let me know what you think.

  3. When I originally commented I clicked the -Notify me when new comments are added- checkbox and now every time a comment is added I get four emails with the same comment. Is there any means you possibly can remove me from that service? Thanks!

  4. Oh my goodness! a tremendous article dude. Thanks Nonetheless I’m experiencing issue with ur rss . Don抰 know why Unable to subscribe to it. Is there anybody getting equivalent rss drawback? Anybody who knows kindly respond. Thnkx

  5. There are some fascinating deadlines on this article but I don抰 know if I see all of them heart to heart. There may be some validity however I’ll take hold opinion until I look into it further. Good article , thanks and we would like more! Added to FeedBurner as effectively

  6. Whats up! I just wish to give a huge thumbs up for the great information you will have right here on this post. I will likely be coming again to your blog for extra soon.

  7. An interesting discussion is worth comment. I think that you need to write extra on this matter, it won’t be a taboo topic however generally persons are not sufficient to talk on such topics. To the next. Cheers

  8. Youre so cool! I dont suppose Ive learn something like this before. So nice to find any individual with some original thoughts on this subject. realy thanks for beginning this up. this web site is one thing that is wanted on the net, someone with just a little originality. useful job for bringing one thing new to the internet!

  9. An interesting discussion is worth comment. I feel that you need to write extra on this matter, it might not be a taboo topic however usually persons are not enough to speak on such topics. To the next. Cheers

  10. Aw, this was a really nice post. In idea I would like to put in writing like this moreover ?taking time and precise effort to make a very good article?but what can I say?I procrastinate alot and not at all appear to get one thing done.

  11. Good post. I be taught one thing tougher on completely different blogs everyday. It will at all times be stimulating to learn content material from different writers and practice a little one thing from their store. I抎 prefer to make use of some with the content material on my weblog whether or not you don抰 mind. Natually I抣l offer you a link on your web blog. Thanks for sharing.

  12. The next time I learn a weblog, I hope that it doesnt disappoint me as a lot as this one. I imply, I do know it was my choice to read, however I actually thought youd have something fascinating to say. All I hear is a bunch of whining about one thing that you might repair if you werent too busy looking for attention.

  13. A powerful share, I just given this onto a colleague who was doing just a little analysis on this. And he in actual fact purchased me breakfast because I found it for him.. smile. So let me reword that: Thnx for the deal with! However yeah Thnkx for spending the time to discuss this, I really feel strongly about it and love reading more on this topic. If possible, as you change into experience, would you thoughts updating your weblog with extra particulars? It’s highly helpful for me. Massive thumb up for this blog submit!

  14. There are some fascinating deadlines on this article however I don抰 know if I see all of them heart to heart. There is some validity however I’ll take maintain opinion till I look into it further. Good article , thanks and we wish more! Added to FeedBurner as nicely

  15. There are certainly lots of particulars like that to take into consideration. That may be a great level to convey up. I offer the ideas above as general inspiration but clearly there are questions like the one you carry up the place crucial factor will be working in sincere good faith. I don?t know if finest practices have emerged around issues like that, but I’m positive that your job is clearly recognized as a fair game. Each girls and boys really feel the influence of only a second抯 pleasure, for the rest of their lives.

  16. There are some interesting cut-off dates on this article but I don抰 know if I see all of them center to heart. There’s some validity but I will take maintain opinion until I look into it further. Good article , thanks and we would like extra! Added to FeedBurner as properly

  17. Spot on with this write-up, I truly think this web site wants far more consideration. I抣l most likely be once more to learn much more, thanks for that info.

  18. There are some interesting points in time on this article but I don抰 know if I see all of them center to heart. There is some validity however I will take hold opinion until I look into it further. Good article , thanks and we wish more! Added to FeedBurner as nicely

  19. I抎 have to verify with you here. Which isn’t one thing I usually do! I get pleasure from studying a submit that can make people think. Also, thanks for permitting me to remark!

  20. This web page is mostly a stroll-through for all the data you needed about this and didn抰 know who to ask. Glimpse right here, and you抣l positively discover it.

  21. You made some first rate factors there. I regarded on the internet for the issue and located most individuals will go together with with your website.

  22. I’m often to blogging and i actually respect your content. The article has really peaks my interest. I’m going to bookmark your website and maintain checking for brand spanking new information.

  23. Nice post. I learn something tougher on different blogs everyday. It’s going to always be stimulating to learn content material from other writers and apply a little bit one thing from their store. I抎 want to make use of some with the content on my blog whether or not you don抰 mind. Natually I抣l provide you with a hyperlink on your internet blog. Thanks for sharing.

  24. There are some attention-grabbing cut-off dates in this article however I don抰 know if I see all of them center to heart. There’s some validity but I will take hold opinion until I look into it further. Good article , thanks and we wish extra! Added to FeedBurner as properly

  25. I抎 must test with you here. Which isn’t something I normally do! I enjoy studying a submit that can make folks think. Also, thanks for permitting me to comment!

  26. This web page is mostly a walk-via for all the information you wished about this and didn抰 know who to ask. Glimpse here, and you抣l definitely uncover it.

  27. Pingback: tinder generator

  28. First of all I want to say fantastic blog! I had a quick question tha토토t I’d like to ask if you do not mind.
    I was interested to find out how you center yourself and clear your thoughts prior to writing.
    I’ve had trouble clearing my mind in getting my ideas out.

  29. Pingback: hydroxychloroquine order online

  30. Pingback: cost of hydroxychloroquine pill

  31. Pingback: how to make hydroxychloroquine

Leave A Reply

X