{"id":424,"date":"2019-02-11T21:03:42","date_gmt":"2019-02-12T01:03:42","guid":{"rendered":"https:\/\/benjaminray.com\/codebase\/?p=424"},"modified":"2024-04-08T01:45:13","modified_gmt":"2024-04-08T04:45:13","slug":"create-wordpress-child-theme-under-enfold","status":"publish","type":"post","link":"https:\/\/benjaminray.com\/codebase\/create-wordpress-child-theme-under-enfold\/","title":{"rendered":"Create WordPress Child Theme Under Enfold"},"content":{"rendered":"<blockquote><p>\n  For the equivalent instructions for the Avada theme, <a href=\"https:\/\/benjaminray.com\/codebase\/create-wordpress-child-theme-under-avada\/\">see here<\/a>.\n<\/p><\/blockquote>\n<p>Creating a WordPress child theme is very straightforward, and it allows you to make major customizations that will not be lost when you update or replace the parent theme. Your customizations are all stored within the child theme.<\/p>\n<p>Note: With the Enfold theme, the child theme's <code>style.css<\/code> is automatically loaded, so you don't have to load it in functions.php.<\/p>\n<p><strong>Step 1:<\/strong> Create a new folder in <code>wp-content\/themes<\/code> with the desired name of your child theme.<\/p>\n<p><strong>Step 2:<\/strong> Create a file in the new folder called <code>style.css<\/code> with the following contents:<\/p>\n<pre><code>\/*\nTheme Name:   Custom Enfold\nTheme URI:    http:\/\/www.benjaminray.com\/example\nDescription:  Custom Version of Enfold Theme\nAuthor:       Benjamin Ray\nAuthor URI:   http:\/\/www.benjaminray.com\nTemplate:     enfold\nVersion:      1.0.0\nLicense:      GNU General Public License v2 or later\nLicense URI:  http:\/\/www.gnu.org\/licenses\/gpl-2.0.html\nTags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready\nText Domain:  custom-enfold\n*\/\n\n\/* Your Custom CSS Here *\/\n<\/code><\/pre>\n<p><strong>Step 3:<\/strong> Create a file in the same folder called <code>functions.php<\/code> with the following contents:<\/p>\n<pre><code>&lt;?php\n    \/\/ Add custom JavaScript to child theme (note: get_stylesheet_directory_uri() gets the child theme directory)\n    function child_theme_js() {\n        wp_enqueue_script( 'child-script', get_stylesheet_directory_uri() . '\/custom.js', ['jquery'], '1.01', true );\n    }\n    add_action('wp_enqueue_scripts', 'child_theme_js');\n?&gt;\n<\/code><\/pre>\n<p><strong>Step 4:<\/strong> Create a file in the same folder called <code>custom.js<\/code> and fill it with your custom JS<\/p>\n<p><strong>Step 5:<\/strong> Create an optional image for the theme. The recommended size is 1200x900. Give it the name <code>screenshot.png<\/code> and upload it to the root folder for your child theme (same location as the files you just created above).<\/p>\n<p><strong>Step 6:<\/strong> Activate the child theme under Appearance -> Themes -> Child Theme Name<\/p>\n<p><strong>Step 7 (optional):<\/strong> If you have already customized the parent Enfold theme, and you want the settings to be applied to your child theme, go to your child theme's options, click \"Import\/Export\" in the left menu, and click \"Import Parent Theme Settings\". You may alternatively use the options \"Export Theme Settings File\" (on the parent theme) followed by \"Import Theme Settings File\" (on the child theme).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For the equivalent instructions for the Avada theme, see here. Creating a WordPress child theme is very straightforward, and it allows you to make major customizations that will not be  [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[20],"tags":[],"class_list":["post-424","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"acf":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9GNjN-6Q","jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/posts\/424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/comments?post=424"}],"version-history":[{"count":12,"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/posts\/424\/revisions"}],"predecessor-version":[{"id":1518,"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/posts\/424\/revisions\/1518"}],"wp:attachment":[{"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/media?parent=424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/categories?post=424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/benjaminray.com\/codebase\/wp-json\/wp\/v2\/tags?post=424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}