{"id":57360,"date":"2021-02-16T12:22:09","date_gmt":"2021-02-16T12:22:09","guid":{"rendered":"https:\/\/www.vwthemes.com\/?p=57360"},"modified":"2021-05-13T11:44:20","modified_gmt":"2021-05-13T11:44:20","slug":"gutenberg-editor-how-to-open-your-posts-code-editor","status":"publish","type":"post","link":"https:\/\/preview.vwthemesdemo.com\/old_website\/gutenberg-editor-how-to-open-your-posts-code-editor\/","title":{"rendered":"Gutenberg Editor: How To Open Your Posts Code Editor"},"content":{"rendered":"\n<p>How To Open Your Posts Code Editor: Have you ever wanted to edit WordPress source code but aren&#8217;t sure how to do so without breaking your site?<\/p>\n\n\n\n<p>Let\u2019s talk about how to edit WordPress code using various methods so that you can find the one that works best for you. If you are a beginner to intermediate level WordPress user and want to learn how to edit WordPress code like HTML, CSS, PHP, JavaScript, etc. Then this is your option.<\/p>\n\n\n\n<p>In the beginning make sure that you have a reliable backup before you start making edits, or consider working on a staging or testing environment first and then pushing your changes live.<\/p>\n\n\n\n<p>First, let&#8217;s talk about how to edit HTML in <a href=\"https:\/\/www.vwthemes.com\/wordpress-website-themes\">WordPress Website Theme<\/a> on an individual page or post. We&#8217;ll start with using Gutenberg block editor, you can use the custom HTML block to add a brand new HTML or if you want to edit the HTML of an existing block then select the \u201coptions\u201d for that block, and then select the \u201cEdit as HTML\u201d option. This will enable you to edit the HTML just for that block. However, if you want to edit the HTML for that entire page, go to the \u201ctools and options\u201d drop-down and select \u201ccode editor\u201d and now you will be able to see the HTML for the entire page.&nbsp;<\/p>\n\n\n\n<p>You may be wondering about editing the HTML on your home page that appears in the form of widgets in your sidebar\u2019s footers etc. From the WordPress dashboard go to \u201cAppearance\u201d and then select \u201cwidgets\u201d in the \u201csub-menu\u201d option, from here you can toggle to the text tab to edit the HTML of that widget area. <\/p>\n\n\n\n<p>Now let&#8217;s talk about how to edit WordPress code across the entire website.<\/p>\n\n\n\n<p>So, the first option is to use the WordPress code editor for your theme CSS and this area is also known as the customizer or the CSS customizer and this comes included in with your theme. To find it from your WordPress dashboard select \u201cappearance\u201d from the navigation menu and then choose the submenu item \u2013 \u2018customize\u2019.<\/p>\n\n\n\n<p>You&#8217;ll be redirected to a page that has a preview of your site on one side and a navigation menu on the other side and at the bottom of this menu select \u2018Additional CSS\u2019. You can now edit your custom CSS in this section and any CSS that you add here will update your preview over on the other<\/p>\n\n\n\n<p>side although it won&#8217;t be published to the live version of your website until you select \u2018publish\u2019.&nbsp;<\/p>\n\n\n\n<p>Remember that this option is specific to your theme so if you switch themes this code will no longer be active so always remember to use a child theme to preserve all of that hard work that you&#8217;ve done.<\/p>\n\n\n\n<p>The second option is to use a plug-in to manage your code snippets and depending on what sort of code you want to add and where it needs to go, you&#8217;ll need to find different plugins.<\/p>\n\n\n\n<p>Once it&#8217;s installed and activated you can navigate to the Settings submenu and select \u201cInsert headers and footers\u201d and will bring you to the settings page for this plugin and here you can paste in any code snippets that you need to use. For example, if you&#8217;re trying to install a Google Analytics. Open  Posts Code Editor than : <\/p>\n\n\n<h2 class=\"test-bundle-banner\"><\/h2>\n\n\n<p>Snippet, you can paste it directly from Google Analytics right into the scripts and header box.&nbsp;<\/p>\n\n\n\n<p>Save your changes and that code is now going to be active on the site, and if you don&#8217;t need it anymore you simply highlight it and delete it, or if you don&#8217;t need any of the code that you&#8217;ve inserted into this plug-in you can simply deactivate and delete the plug-in altogether.<\/p>\n\n\n\n<p>Now, this isn&#8217;t just for JavaScript, you can also use plugins to add CSS instead of using the customizer as mentioned in the option above.<\/p>\n\n\n\n<p>Option number three will enable you to edit your code directly in the dashboard using the Gutenberg code editor and this way you can edit PHP theme files, CSS, JavaScript, and almost anything that you want.&nbsp;<\/p>\n\n\n\n<p>It&#8217;s added directly to the code files and it&#8217;s not dependent on a third-party plug-in which is indeed a plus point. However, this method can be a little bit riskier as there is no preview to show what you&#8217;re doing, so you need to be certain to take appropriate safety measures as we have guided you throughout this post before trying this method.<\/p>\n\n\n\n<p>To get to the Gutenberg code editor start from the \u201cDashboard\u201d &#8211; select \u201cAppearance\u201d and then the \u201cTheme Editor\u201d submenu, use the links along the side to locate the file that you want to edit, and just click on it to open it up and start editing.<\/p>\n\n\n\n<p>Note: You can only edit files here however, you cannot remove or add them, but once you\u2019ve found the file that you want to edit and have made your edits, select \u201cUpdate File\u201d and now your changes are live&nbsp;<\/p>\n\n\n\n<p>So, here we have given you a brief on the three ways to edit the WordPress source code for your website. Always remember to take backups as a safety precaution before you begin editing code. This is How To Open Your Posts Code Editor.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How To Open Your Posts Code Editor: Have you ever wanted to edit WordPress source code but aren&#8217;t sure how to do so without breaking your site? Let\u2019s talk about how to edit WordPress code using various methods so that you can find the one that works best for you. If you are a beginner [&hellip;]<\/p>\n","protected":false},"author":9250,"featured_media":62085,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-57360","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-about-wp-themes"],"_links":{"self":[{"href":"https:\/\/preview.vwthemesdemo.com\/old_website\/wp-json\/wp\/v2\/posts\/57360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/preview.vwthemesdemo.com\/old_website\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/preview.vwthemesdemo.com\/old_website\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/preview.vwthemesdemo.com\/old_website\/wp-json\/wp\/v2\/users\/9250"}],"replies":[{"embeddable":true,"href":"https:\/\/preview.vwthemesdemo.com\/old_website\/wp-json\/wp\/v2\/comments?post=57360"}],"version-history":[{"count":5,"href":"https:\/\/preview.vwthemesdemo.com\/old_website\/wp-json\/wp\/v2\/posts\/57360\/revisions"}],"predecessor-version":[{"id":62687,"href":"https:\/\/preview.vwthemesdemo.com\/old_website\/wp-json\/wp\/v2\/posts\/57360\/revisions\/62687"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/preview.vwthemesdemo.com\/old_website\/wp-json\/wp\/v2\/media\/62085"}],"wp:attachment":[{"href":"https:\/\/preview.vwthemesdemo.com\/old_website\/wp-json\/wp\/v2\/media?parent=57360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/preview.vwthemesdemo.com\/old_website\/wp-json\/wp\/v2\/categories?post=57360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/preview.vwthemesdemo.com\/old_website\/wp-json\/wp\/v2\/tags?post=57360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}