{"id":4454,"date":"2014-05-17T09:28:06","date_gmt":"2014-05-17T09:28:06","guid":{"rendered":"http:\/\/demo.momizat.net\/goodnews\/?p=117"},"modified":"2014-05-17T09:28:06","modified_gmt":"2014-05-17T09:28:06","slug":"options-for-wordpress-theme-development","status":"publish","type":"post","link":"https:\/\/bulandrashtrawadi.in\/?p=4454","title":{"rendered":"The Options For WordPress Theme Development"},"content":{"rendered":"<p>At the recent <a href=\"http:\/\/2012.edinburgh.wordcamp.org\/\">WordCamp Edinburgh<\/a>, 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 <strong>there isn\u2019t a one-size-fits-all answer<\/strong> and that the best method depends on the needs of the website and the capabilities of the developer.<\/p>\n<p>But if you\u2019re 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\u2019ll 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.<\/p>\n<h3>How Does A WordPress Theme Work?<\/h3>\n<p>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 \u2014 which you might already be doing if you\u2019ve downloaded themes from <a href=\"http:\/\/wordpress.org\/extend\/themes\/\">WordPress\u2019 theme repository<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<h3>What To Consider When Developing A WordPress Theme?<\/h3>\n<p>Before deciding which approach to take to develop your theme, identify your constraints. These likely include the following:<\/p>\n<ul>\n<li><strong>Time<\/strong><br \/>\nHow much time do you have to develop your theme, or to learn how to do it?<\/li>\n<li><strong>Budget<\/strong><br \/>\nThis is related to time but also has to do with whether you can afford to pay for a premium theme or a theme framework.<\/li>\n<li><strong>Capability<\/strong><br \/>\nHow familiar are you with theme development, with CSS and PHP and with how themes work? If you\u2019re not familiar, how much do you want to learn?<\/li>\n<li><strong>Future-proofing<\/strong><br \/>\nWill 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.<\/li>\n<li><strong>Repetition<\/strong><br \/>\nDo you see yourself developing a number of similar themes in future? If so, your approach will have to allow for code to be reused.<\/li>\n<\/ul>\n<p>We\u2019ll revisit these considerations at the end of the article and identify which development options are most suitable for various situations.<\/p>\n<h3>Theme Development: Your Options<\/h3>\n<p>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\u2019ll have to do later. It will also help you to build the theme more efficiently.<\/p>\n<p>The options we\u2019ll look at here are:<\/p>\n<ul>\n<li>Build a theme from scratch,<\/li>\n<li>Edit (or \u201chack,\u201d some might say) an existing theme,<\/li>\n<li>Use the theme customizer to tweak an existing theme,<\/li>\n<li>Create a child theme to make changes to an existing theme,<\/li>\n<li>Create your own parent theme (using one of the approaches above) and child themes,<\/li>\n<li>Use a theme framework.<\/li>\n<\/ul>\n<h4>1. BUILD A THEME FROM SCRATCH<\/h4>\n<p>This approach is the most difficult if you\u2019re inexperienced. But if you\u2019re a seasoned WordPress developer, it will give you the <strong>most control<\/strong>. It might be the most appropriate method if you\u2019re importing HTML from an existing static website that is being upgraded to WordPress with no other changes.<\/p>\n<p>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\u2019ll need to keep a close eye on your code to ensure that it\u2019s clean, efficient and valid.<\/p>\n<h4>2. EDIT (OR HACK) AN EXISTING THEME<\/h4>\n<p>This is how most people start with WordPress theme development: in working on a theme that they\u2019ve downloaded, they see that some styling isn\u2019t 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 <strong>there are some dangers<\/strong>:<\/p>\n<ul>\n<li>If you ever switch themes, that update will override any changes you\u2019ve made.<\/li>\n<li>It\u2019s 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\u2019t need.<\/li>\n<li>The website could end up with a lot more code than it needs.<\/li>\n<li>If the theme isn\u2019t 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.<\/li>\n<\/ul>\n<p>However, hacking a theme can work if you <strong>go into it with your eyes open<\/strong>. It may be an option if the following are true:<\/p>\n<ul>\n<li>The theme you\u2019re using is well written, valid and commented (e.g., the default WP theme, Twenty Eleven);<\/li>\n<li>The changes you\u2019re making are so drastic that you wouldn\u2019t need to update the original theme;<\/li>\n<li>You understand the PHP and CSS contained in the theme and are comfortable editing, adding to and removing it without breaking the theme.<\/li>\n<\/ul>\n<p>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\u2019t want and then testing to see what happens before deleting anything.<\/p>\n<h4>3. USE THE THEME CUSTOMIZER TO TWEAK AN EXISTING THEME<\/h4>\n<p>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.<\/p>\n<p><a href=\"http:\/\/media.mediatemple.netdna-cdn.com\/wp-content\/uploads\/2012\/08\/wordpress_theme_customizer.jpg\"><img decoding=\"async\" class=\"size-full wp-image-106917\" title=\"Using the WordPress theme customizer with the Twenty Ten theme.\" src=\"http:\/\/media.mediatemple.netdna-cdn.com\/wp-content\/uploads\/2012\/08\/wordpress_theme_customizer.jpg\" alt=\"Using the WordPress theme customizer with the Twenty Ten theme.\" \/><\/a><br \/>\n<em>Using the WordPress theme customizer with the Twenty Ten theme.<\/em><\/p>\n<p>The theme customizer stores your changes in a separate file, not in the theme\u2019s style sheet, so there will be repetitive code.<\/p>\n<p>For more information, take a look at Otto on WordPress\u2019 <a href=\"http:\/\/www.youtube.com\/watch?v=vD8v6u3noPg\">video tutorial<\/a> or <a href=\"http:\/\/ottopress.com\/2012\/how-to-leverage-the-theme-customizer-in-your-own-themes\/\">guide to integrating the theme customizer into your own themes<\/a>.<\/p>\n<h4>4. CREATE A CHILD THEME TO MAKE CHANGES TO AN EXISTING THEME<\/h4>\n<p>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\u2019t 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\u2019s 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.<\/p>\n<p>So, that\u2019s how child themes work. But when is this <strong>the best approach?<\/strong> I would suggest using it in the following cases:<\/p>\n<ul>\n<li>You already have a theme (to be used as the parent) that contains most of what you need for your theme;<\/li>\n<li>You want to be able to update your parent theme (for example, when theme updates are released following a WordPress update);<\/li>\n<li>You don\u2019t want to get tied up in knots from hacking an existing theme;<\/li>\n<li>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);<\/li>\n<li>You\u2019re 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);<\/li>\n<li>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\u2019s code will override anything affected by updates to the parent theme.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>from : http:\/\/www.smashingmagazine.com\/2013\/03\/13\/a-guide-to-wordpress-theme-options\/<\/p>\n<blockquote class=\"mom_quote \" style=\"font-family:verdana;font-size:14px;font-style:italic;border-left-color:#dd9933; color:#474747; background-color:#F5F5F5; \"><span class=\"quote-arrow\" style=\"border-left-color:#dd9933;\"><\/span>This Demo Content Brought to you by <a href=\"http:\/\/momizat.com\/\" target=\"_blank\" rel=\"dofollow noopener\">Momizat Team<\/a> <\/blockquote>\n<h2>this is tags and keywords : wordpress themes momizat Tutorial wordpress  templates<\/h2>\n","protected":false},"excerpt":{"rendered":"<p>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\u2019t a one-size-fits-all answer and that the best method depends on the needs of the website and the capabilities of the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":118,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[75,78,79,80,83],"_links":{"self":[{"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=\/wp\/v2\/posts\/4454"}],"collection":[{"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4454"}],"version-history":[{"count":0,"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=\/wp\/v2\/posts\/4454\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=\/wp\/v2\/media\/118"}],"wp:attachment":[{"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bulandrashtrawadi.in\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}