{"id":2781481,"date":"2018-10-04T09:28:44","date_gmt":"2018-10-04T09:28:44","guid":{"rendered":"https:\/\/wpml.org\/?p=2781481"},"modified":"2021-01-18T11:32:57","modified_gmt":"2021-01-18T11:32:57","slug":"customize-your-site-with-new-custom-code-feature","status":"publish","type":"post","link":"https:\/\/wpml.org\/es\/announcements\/2018\/10\/customize-your-site-with-new-custom-code-feature\/","title":{"rendered":"Customize your site with new Custom Code feature"},"content":{"rendered":"<p class=\"lead\">Sometimes, you need to extend your site using custom code. Toolset Types, available for download from your WPML account, allows you to add custom code from the WordPress admin. No need to edit PHP files or create child themes.<\/p>\n<p>Recently, we added a complimentary\u00a0plugin, <a href=\"https:\/\/wpml.org\/documentation\/plugins-compatibility\/toolset\/\">Toolset Types<\/a>, to all WPML clients&#8217; accounts. This plugin lets you build advanced WordPress sites without programming.<\/p>\n<h2>Why use Toolset to add custom code to your site?<\/h2>\n<p>Using Toolset to add custom code to your site brings some important benefits:<\/p>\n<ul>\n<li><strong>Your custom code is separate from your theme.<\/strong> Updating or switching a theme will not impact your custom code. Also, there is no need to create a child theme just to add a custom code snippet.<\/li>\n<li><strong>No need to edit the PHP files<\/strong> in your site to add custom code, you do it from the WordPress admin.<\/li>\n<li><strong>Easily enable or disable your custom code<\/strong> by using the backend interface.<\/li>\n<li><strong>Easily select where your code is run.<\/strong> This can be on the front-end, on the backend, or inside AJAX calls.<\/li>\n<li><strong>Execution of your custom code is automatically checked by Toolset.<\/strong> Toolset will catch any major issues with your custom code. For example, it can prevent a fatal error caused by your code, simply by not executing it if an issue is detected.<\/li>\n<\/ul>\n<p>Are you wondering how those code snippet actually look like and what you can do with them? If you are, be sure to take a look at some <a href=\"https:\/\/toolset.com\/documentation\/adding-custom-code\/#useful-code-snippets-for-your-sites\">code snippets<\/a> that we have created for you.<\/p>\n<h2>How to add custom code using Toolset<\/h2>\n<p>The best part is that it&#8217;s very easy to add custom code using Toolset.<\/p>\n<p>After installing the Toolset Types plugin go to the <strong>Toolset <\/strong>\u2192 <strong>Settings <\/strong>page and click the <strong>Custom code<\/strong> tab. There, click the <strong>Add new<\/strong> button, define a slug for your custom code and enter the code.<\/p>\n<figure id=\"attachment_2781580\" aria-describedby=\"caption-attachment-2781580\" style=\"width: 1024px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/wpml.org\/wp-content\/uploads\/2018\/10\/wpml-views-types-custom-code.png\"><img decoding=\"async\" class=\"wp-image-2781580 size-large\" src=\"https:\/\/wpml.org\/wp-content\/uploads\/2018\/10\/wpml-views-types-custom-code-1024x829.png\" alt=\"Admin screen for adding custom code using Toolset\" width=\"1024\" height=\"829\" srcset=\"https:\/\/wpml.org\/wp-content\/uploads\/2018\/10\/wpml-views-types-custom-code-1024x829.png 1024w, https:\/\/wpml.org\/wp-content\/uploads\/2018\/10\/wpml-views-types-custom-code-150x121.png 150w, https:\/\/wpml.org\/wp-content\/uploads\/2018\/10\/wpml-views-types-custom-code-300x243.png 300w, https:\/\/wpml.org\/wp-content\/uploads\/2018\/10\/wpml-views-types-custom-code-768x622.png 768w, https:\/\/wpml.org\/wp-content\/uploads\/2018\/10\/wpml-views-types-custom-code.png 1263w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption id=\"caption-attachment-2781580\" class=\"wp-caption-text\">Admin screen for adding custom code using Toolset<\/figcaption><\/figure>\n<p>When done click <strong>Save and close<\/strong> and activate the code snippet.<\/p>\n<p>That&#8217;s it, your first custom code is ready to be used!<\/p>\n<h2>Find out more<\/h2>\n<p>You can learn more about this feature in the official Toolset documentation about <a href=\"https:\/\/toolset.com\/documentation\/adding-custom-code\/\">adding custom code to your WordPress site<\/a>.<\/p>\n<p>It features a nice introduction to custom coding, detailed instructions for using the custom code feature in Toolset, and some useful snippets you can reuse on your sites.<\/p>\n<h2>What do you think?<\/h2>\n<p>Any thoughts or question? Leave us a comment and let us know if you find the custom code feature useful.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes, you need to extend your site using custom code. Toolset Types, available for download from your WPML account, allows you to add custom code from the WordPress admin. No need to edit PHP files or create child themes. Recently, we added a complimentary\u00a0plugin, Toolset Types, to all WPML clients&#8217; accounts. This plugin lets you [&hellip;]<\/p>\n","protected":false},"author":76577,"featured_media":2784781,"comment_status":"open","ping_status":"closed","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,"ep_exclude_from_search":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-2781481","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcements"],"_links":{"self":[{"href":"https:\/\/wpml.org\/es\/wp-json\/wp\/v2\/posts\/2781481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpml.org\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpml.org\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpml.org\/es\/wp-json\/wp\/v2\/users\/76577"}],"replies":[{"embeddable":true,"href":"https:\/\/wpml.org\/es\/wp-json\/wp\/v2\/comments?post=2781481"}],"version-history":[{"count":9,"href":"https:\/\/wpml.org\/es\/wp-json\/wp\/v2\/posts\/2781481\/revisions"}],"predecessor-version":[{"id":7868239,"href":"https:\/\/wpml.org\/es\/wp-json\/wp\/v2\/posts\/2781481\/revisions\/7868239"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpml.org\/es\/wp-json\/wp\/v2\/media\/2784781"}],"wp:attachment":[{"href":"https:\/\/wpml.org\/es\/wp-json\/wp\/v2\/media?parent=2781481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpml.org\/es\/wp-json\/wp\/v2\/categories?post=2781481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpml.org\/es\/wp-json\/wp\/v2\/tags?post=2781481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}