{"id":3430,"date":"2014-10-30T15:42:35","date_gmt":"2014-10-30T15:42:35","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2014\/10\/30\/wp-childtheme-2014\/"},"modified":"2021-08-16T22:58:15","modified_gmt":"2021-08-17T02:58:15","slug":"wp-childtheme-2014","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/","title":{"rendered":"Creating a Child Theme in WordPress"},"content":{"rendered":"<p>If you want to modify a WordPress theme, you should create what\u2019s called a <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/themes\/when-create-wordpress-child-theme\/\"><i>child theme<\/i><\/a>. A <i>child theme<\/i> allows you to make updates that would not be overwritten by updates to the theme. Theme updates occur on a regular basis, usually in response to updates to WordPress.<\/p>\n<p>If the modifications were made to the main theme, then they would be erased upon the theme update. The <i>child theme<\/i> allows you to avoid losing your modifications. The following article takes you through the steps needed to create a basic <i>child theme<\/i>.<\/p>\n<h2>How to Create a Child Theme<\/h2>\n<ol class=\"article_list\">\n<li style=\"list-style-type: none;\">\n<ol class=\"article_list\">\n<li><a href=\"\/support\/edu\/cpanel\/how-to-log-into-cpanel\/\">Login to the cPanel<\/a>.<\/li>\n<li>Open the <a href=\"\/support\/edu\/cpanel\/using-file-manager-in-cpanel\/\">cPanel File Manager<\/a> and then go to your WordPress installation directory. Look for the <b>wp-content\/themes<\/b> folder.<\/li>\n<li>Create a New Folder and name it <i>2014child<\/i>. You can actually name this folder any name, but to keep things simple and easy to understand we will name it <i>2014child<\/i>.<\/li>\n<li>In <b>File Manager<\/b>, click on the newly created folder to open it. Click on <b>Create New File<\/b> to create a new file named <i>style.css<\/i>.<\/li>\n<li>Using the same steps, create another file called <i>functions.php<\/i>.<\/li>\n<li>In File Manager, click on your newly created CSS file and edit the file by clicking on <b>Code Editor<\/b> in the menu. Add the following into the blank <i>style.css file:<\/i><br>\n<code><br>\n\/*<br>\nTheme Name: 2014-Child-theme<br>\nAuthor: My Child theme<br>\nTemplate: twentyfourteen<br>\n*\/<\/code><\/li>\n<li>Click <b>Save Changes<\/b> in order to save the changes to the <i>style.css<\/i> file.<\/li>\n<li>Next, you will edit the <i>functions.php<\/i> file that you just created. Click on the file, and edit it with the <b>Code Editor<\/b> as you did the last file. Add the following code:<br>\n<code><br>\n&lt;?php<br>\nadd_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );<br>\nfunction theme_enqueue_styles() {<br>\nwp_enqueue_style( 'parent-style', get_template_directory_uri() . '\/style.css' );<br>\nwp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parent-style' ) );<br>\n}<br>\n<\/code><br>\nThis code is the final step in creating the child theme. As per WordPress, the code in the <i>functions.php<\/i> allows you to <i>enqueue<\/i> the parent theme stylesheets. <b><i>NOTE: The previous method of using \u201c@import\u201d is no longer considered best practice for importing the parent theme stylesheet.<\/i><\/b> For more information, please see <a href=\"https:\/\/codex.wordpress.org\/Child_Themes\" target=\"_blank\" rel=\"noopener noreferrer\">WordPress Codex: child themes<\/a>.<\/li>\n<li>Click <b>Save Changes<\/b> in order to save the changes to the <i>functions.php<\/i> file.<\/li>\n<li><a href=\"\/support\/images\/stories\/wp-child-theme\/child-theme.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" style=\"float: right; margin: 0px 0px 15px 15px;\" src=\"\/support\/images\/stories\/wp-child-theme\/child-theme.png\" alt=\"Activate child theme\" width=\"100\" align=\"right\"><\/a>\n<div style=\"clear: both;\"><\/div>\n<p>Go back into your WordPress dashboard. In the menu, select <b>Appearance &gt;Themes<\/b>. When you look at the list of themes, you should see your Child theme listed under available themes. Click on <b>ACTIVATE<\/b> under your child theme to make it the active WordPress theme.<\/p>\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><i>Optional step: <\/i>In order to provide a thumbnail of your Child theme in the theme list, you will need to add an image in the folder that you created for the child theme. The image is typically a screenshot of the theme and should be either a PNG, JPEG or GIF file. Make sure that the size of the image is 300 px wide by 225 px high. Once you have the file, name it <i>screenshot.jpg<\/i> and copy into the child theme folder.<\/li>\n<li>We will be adding code to the CSS file of the child theme in order to change the font, font color and alignment of the site title. The code also centers the entire site since the 2014 theme was designed to be left-aligned.<br>\n<code><br>\n#site-title<br>\n#site-description {<br>\nfont-family: Georgia, \"Times New Roman\", Times, serif;<br>\nfont-weight:bold;<br>\ntext-align: center;<br>\nmargin:10px auto;<br>\ncolor #e56c07<br>\n}<br>\n#site-title a {<br>\ncolor: #0c8fbe<br>\n}<br>\n.site {<br>\nmargin: 0 auto;<br>\n}<\/code><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>The code above changes your fonts and centers the site orientation. To see a before and after view of the WordPress site with the changes take a look at the screen captures below. The original site is left aligned, so you will see a white space on the right. The child theme is centered so that content is centered in the screen.<\/p>\n<table width=\"50%\" cellspacing=\"3\" cellpadding=\"4\">\n<tbody>\n<tr>\n<td>BEFORE<\/td>\n<td>AFTER<\/td>\n<\/tr>\n<tr>\n<td><a href=\"\/support\/images\/stories\/wp-child-theme\/wp-2014-cap2.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" src=\"\/support\/images\/stories\/wp-child-theme\/wp-2014-cap2.png\" alt=\"Unmodified 2014 Theme\" width=\"200\"><\/a>\n<div style=\"clear: both;\"><\/div>\n<\/td>\n<td><a href=\"\/support\/images\/stories\/wp-child-theme\/wp-child-theme-cap2.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" src=\"\/support\/images\/stories\/wp-child-theme\/wp-child-theme-cap2.png\" alt=\"Child theme modifying the 2014 theme\" width=\"200\"><\/a>\n<div style=\"clear: both;\"><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol class=\"article_list\">\n<li>Click the <b>Save Changes<\/b> button to save our new CSS declarations.<\/li>\n<\/ol>\n<p>This completes the tutorial on creating a child them using the WordPress twenty-fourteen theme. Note that this is only the foundation upon which you will base all of your future changes to the site. Child themes are used to preserve modifications to a theme so that theme updates do not destroy your changes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to modify a WordPress theme, you should create what\u2019s called a child theme. A child theme allows you to make updates that would not be overwritten by updates to the theme. Theme updates occur on a regular basis, usually in response to updates to WordPress. If the modifications were made to the<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/\"> Read More ><\/a><\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4325,56],"tags":[],"class_list":["post-3430","post","type-post","status-publish","format-standard","hentry","category-wordpress-hosting","category-wordpress"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Creating a Child Theme in WordPress | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"Learn how to create a child theme in WordPress\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating a Child Theme in WordPress | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Learn how to create a child theme in WordPress\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2014-10-30T15:42:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-17T02:58:15+00:00\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/8d626175dd3b70ee90a172bdb09a460b\"},\"headline\":\"Creating a Child Theme in WordPress\",\"datePublished\":\"2014-10-30T15:42:35+00:00\",\"dateModified\":\"2021-08-17T02:58:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/\"},\"wordCount\":637,\"commentCount\":9,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"WordPress Hosting\",\"WordPress Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/\",\"name\":\"Creating a Child Theme in WordPress | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2014-10-30T15:42:35+00:00\",\"dateModified\":\"2021-08-17T02:58:15+00:00\",\"description\":\"Learn how to create a child theme in WordPress\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating a Child Theme in WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/8d626175dd3b70ee90a172bdb09a460b\",\"name\":\"InMotion Hosting Contributor\",\"description\":\"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/inmotion-hosting\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/arn\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating a Child Theme in WordPress | InMotion Hosting","description":"Learn how to create a child theme in WordPress","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/","og_locale":"en_US","og_type":"article","og_title":"Creating a Child Theme in WordPress | InMotion Hosting","og_description":"Learn how to create a child theme in WordPress","og_url":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2014-10-30T15:42:35+00:00","article_modified_time":"2021-08-17T02:58:15+00:00","author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/8d626175dd3b70ee90a172bdb09a460b"},"headline":"Creating a Child Theme in WordPress","datePublished":"2014-10-30T15:42:35+00:00","dateModified":"2021-08-17T02:58:15+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/"},"wordCount":637,"commentCount":9,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["WordPress Hosting","WordPress Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/","url":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/","name":"Creating a Child Theme in WordPress | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2014-10-30T15:42:35+00:00","dateModified":"2021-08-17T02:58:15+00:00","description":"Learn how to create a child theme in WordPress","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-childtheme-2014\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Creating a Child Theme in WordPress"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/8d626175dd3b70ee90a172bdb09a460b","name":"InMotion Hosting Contributor","description":"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!","sameAs":["https:\/\/www.linkedin.com\/company\/inmotion-hosting\/","https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/arn\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":56,"name":"WordPress Tutorials","slug":"wordpress","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=3430"}],"version-history":[{"count":4,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3430\/revisions"}],"predecessor-version":[{"id":84179,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3430\/revisions\/84179"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=3430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=3430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=3430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}