{"id":62539,"date":"2024-02-13T09:50:41","date_gmt":"2024-02-13T14:50:41","guid":{"rendered":"https:\/\/memberpress.com\/docs\/how-to-add-custom-code-snippets-in-wpcode\/"},"modified":"2024-02-13T17:17:41","modified_gmt":"2024-02-13T22:17:41","slug":"how-to-add-custom-code-snippets-in-wpcode","status":"publish","type":"ht_kb","link":"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/","title":{"rendered":"Como adicionar trechos de c\u00f3digo personalizados no WPCode"},"content":{"rendered":"<p>Se quiser adicionar c\u00f3digo personalizado ao seu site, voc\u00ea pode usar um de nossos <a href=\"https:\/\/memberpress.com\/pt\/docs\/action-hooks-in-memberpress\/\" target=\"_blank\" rel=\"noopener\">a\u00e7\u00e3o<\/a> ou <a href=\"https:\/\/memberpress.com\/pt\/docs\/filter-hooks-in-memberpress\/\" target=\"_blank\" rel=\"noopener\">filtro<\/a> adicione o c\u00f3digo no final do arquivo functions.php do seu tema ou use um dos ganchos <b>plug-ins de snippets de c\u00f3digo<\/b>.<\/p><p>Usar um plug-in de c\u00f3digo personalizado pode ser uma op\u00e7\u00e3o melhor por alguns motivos:<\/p><ul><li>Voc\u00ea tem mais controle sobre seus snippets<\/li><li>Voc\u00ea pode ativ\u00e1-los se precisar<\/li><li>Voc\u00ea pode evitar poss\u00edveis erros<\/li><li>Voc\u00ea pode us\u00e1-los no back-end, no front-end ou somente em p\u00e1ginas espec\u00edficas<\/li><li>Muitos, como o WPCode, n\u00e3o exigem que voc\u00ea tenha conhecimento de codifica\u00e7\u00e3o<\/li><\/ul><p>Neste documento, mostraremos a voc\u00ea como usar <a href=\"https:\/\/wordpress.org\/plugins\/insert-headers-and-footers\/\" target=\"_blank\" rel=\"noopener\">WPCode - Inserir cabe\u00e7alhos e rodap\u00e9s + snippets de c\u00f3digo personalizado<\/a> com MemberPress.<\/p><h2>Tutorial em v\u00eddeo<\/h2><iframe width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/mDYQU3TK_aQ?enablejsapi=1\" title=\"Reprodutor de v\u00eddeo do YouTube\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen=\"\"><\/iframe><p>Depois de instalar e ativar o plug-in WPCode na se\u00e7\u00e3o de plug-ins, voc\u00ea ver\u00e1 uma se\u00e7\u00e3o Code Snippets no painel do WordPress.<\/p><p><img decoding=\"async\" src=\"https:\/\/memberpress.com\/wp-content\/uploads\/2024\/02\/file-deUhYLoPgS.png\" style=\"width: 869.989px; max-width: 100%; \"><\/p><p>Para adicionar trechos de c\u00f3digo, primeiro clique no bot\u00e3o Add New (Adicionar novo) na parte superior da se\u00e7\u00e3o Code Snippets (Trechos de c\u00f3digo).<\/p><p>Voc\u00ea ver\u00e1 uma nova janela Add Snippet.<\/p><p>Em seguida, passe o mouse sobre a se\u00e7\u00e3o \"Add Your Custom Code (New Snippet)\" e clique no bot\u00e3o Use Snippet.<\/p><p>\n\t<img decoding=\"async\" src=\"https:\/\/memberpress.com\/wp-content\/uploads\/2024\/02\/file-64wv1b67E0.png\" style=\"background-color: initial; width: 871.989px;\"><\/p><p>Na nova janela, voc\u00ea precisa:<\/p><ol><li>Adicionar um t\u00edtulo<\/li><li>Altere o tipo de c\u00f3digo para PHP Snippet (para que a sintaxe do c\u00f3digo seja verificada quanto a erros)<\/li><li>Adicione seu trecho de c\u00f3digo ao campo \"Code Preview\" (Visualiza\u00e7\u00e3o de c\u00f3digo)<\/li><li>Certifique-se de que a op\u00e7\u00e3o \"Auto Insert\" (Inser\u00e7\u00e3o autom\u00e1tica) esteja selecionada<\/li><li>Marque o campo de caixa de sele\u00e7\u00e3o \"Inactive\" (Inativo) para torn\u00e1-lo \"Active\" (Ativo)<\/li><li>Altere o local para \"Somente front-end\"<\/li><li>Clique no bot\u00e3o \"Save Snippet\" para salvar o trecho de c\u00f3digo<\/li><\/ol><p><img decoding=\"async\" src=\"https:\/\/memberpress.com\/wp-content\/uploads\/2024\/02\/file-IAApesLljb.png\" style=\"width: 862.989px; max-width: 100%; \"><\/p><p>\u00c9 isso a\u00ed! Seu snippet de c\u00f3digo deve funcionar.<\/p><p>\u00c9 f\u00e1cil ativar e desativar os snippets de c\u00f3digo. Tudo o que voc\u00ea precisa fazer \u00e9 marcar\/desmarcar as caixas sob a coluna Status na tabela Code Snippets.<\/p><p><img decoding=\"async\" src=\"https:\/\/memberpress.com\/wp-content\/uploads\/2024\/02\/file-Q1YA8kcWtk.png\" style=\"width: 100%; max-width: 100%; \"><\/p><h3>O local onde seu snippet de c\u00f3digo ser\u00e1 executado<\/h3><p>No exemplo acima, usamos o <a href=\"https:\/\/memberpress.com\/pt\/docs\/filter-hooks-in-memberpress\/#mepr-account-nav-home-label\" target=\"_blank\" rel=\"noopener\">mepr-account-nav-home-label<\/a> gancho de filtro para alterar o r\u00f3tulo Home na p\u00e1gina Account (Conta) no frontend.<\/p><p>Portanto, usamos \"Frontend Only\" (Somente front-end) como o local. Isso significa que o snippet de c\u00f3digo ser\u00e1 executado somente no frontend (ou seja, em todas as p\u00e1ginas \u00e0s quais os usu\u00e1rios comuns t\u00eam acesso, inclusive a p\u00e1gina Account).<\/p><p>Tamb\u00e9m poder\u00edamos usar a op\u00e7\u00e3o \"Run Everywhere\". Dessa forma, o c\u00f3digo seria executado em todo o site, inclusive no painel do WordPress (o backend).<\/p><p>Se voc\u00ea quiser usar um dos hooks de filtro que s\u00e3o executados somente no back-end (por exemplo, <a href=\"https:\/\/memberpress.com\/pt\/docs\/filter-hooks-in-memberpress\/#mepr-admin-subscriptions-cols\" target=\"_blank\" rel=\"noopener\">mepr-admin-subscriptions-cols<\/a>), voc\u00ea pode usar a op\u00e7\u00e3o \"Admin Only\" do Location.<\/p><p><img decoding=\"async\" src=\"https:\/\/memberpress.com\/wp-content\/uploads\/2024\/02\/file-9T9dswdqr2.png\" style=\"width: 100%; max-width: 100%; \"><\/p><h3>L\u00f3gica condicional<\/h3><p>Observe que o WPCode tem outras op\u00e7\u00f5es nas quais voc\u00ea pode executar trechos de c\u00f3digo. Por exemplo, voc\u00ea pode execut\u00e1-los somente para usu\u00e1rios conectados, p\u00e1ginas espec\u00edficas ou para usu\u00e1rios que tenham uma fun\u00e7\u00e3o selecionada. <\/p><p>Para isso, marque a caixa de sele\u00e7\u00e3o \"Enable Logic\" (Ativar l\u00f3gica) na se\u00e7\u00e3o \"Smart Conditional Logic\" (L\u00f3gica condicional inteligente).<\/p><p><img decoding=\"async\" src=\"https:\/\/memberpress.com\/wp-content\/uploads\/2024\/02\/file-Z7txLYDsDE.png\" style=\"width: 877.989px; max-width: 100%; \"><\/p><h2>Integra\u00e7\u00e3o do WPCode Snippets Pro com o MemberPress<\/h2><p>Se voc\u00ea usar o WPCode Snippets Pro, poder\u00e1 controlar adicionalmente onde e em quais casos seus trechos de c\u00f3digo ser\u00e3o executados com base no local e nas condi\u00e7\u00f5es do MemberPress. Al\u00e9m disso, voc\u00ea pode adicionar seus Pixels de Convers\u00e3o para rastrear suas compras no MemberPress.<\/p><p>Verifique os seguintes documentos espec\u00edficos:<\/p><ul><li><a href=\"https:\/\/memberpress.com\/pt\/docs\/wpcode-locations-for-memberpress\/\" target=\"_blank\" rel=\"noopener\">Locais de inser\u00e7\u00e3o autom\u00e1tica de WPCode para MemberPress<\/a><\/li><li><a href=\"https:\/\/memberpress.com\/pt\/docs\/wpcode-conditional-logic-for-memberpress\/\" target=\"_blank\" rel=\"noopener\">Regras de l\u00f3gica condicional do WPCode para o MemberPress<\/a><\/li><li><a href=\"https:\/\/memberpress.com\/pt\/docs\/wpcode-conversion-pixels-with-memberpress\/\" target=\"_blank\" rel=\"noopener\">Use os pixels de convers\u00e3o do WPCode com o MemberPress<\/a><\/li><\/ul>\n        <div class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\"><h2>Ajuda?<\/h2><p>Isso n\u00e3o est\u00e1 funcionando como voc\u00ea acha que deveria, mesmo depois de seguir as instru\u00e7\u00f5es? Sinta-se \u00e0 vontade para nos enviar um <a href=\"https:\/\/memberpress.com\/pt\/support\/\"><b>Ticket de suporte<\/b><\/a>!<\/p><\/div>","protected":false},"excerpt":{"rendered":"<p>If you want to add custom code to your site, you can use one of our action or filter hooks, add the code at the end of your theme\u2019s functions.php file, or use one of the code snippets plugins. Using a custom code plugin can be a better option for a few reasons: You get [\u2026]<\/p>\n","protected":false},"author":62252,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"om_disable_all_campaigns":false,"_strive_editorial_status":"not-started","_strive_copy_of":0,"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","_FSMCFIC_featured_image_caption":"","_FSMCFIC_featured_image_nocaption":"","_FSMCFIC_featured_image_hide":"","_strive_checklists":"\"\"","_strive_active_checklist":"62291e2bb2422","footnotes":""},"ht-kb-category":[1354],"ht-kb-tag":[],"class_list":{"0":"post-62539","1":"ht_kb","2":"type-ht_kb","3":"status-publish","4":"format-standard","6":"ht_kb_category-using-custom-codes","7":"entry","8":"has-post-thumbnail"},"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO Pro 4.9.5.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"If you want to add custom code to your site, you can use one of our action or filter hooks, add the code at the end of your theme\u2019s functions.php file, or use one of the code snippets plugins. Using a custom code plugin can be a better option for a few reasons: You get\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Nikola M\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO Pro (AIOSEO) 4.9.5.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"pt_BR\" \/>\n\t\t<meta property=\"og:site_name\" content=\"MemberPress\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"How to add custom code snippets in WPCode | MemberPress\" \/>\n\t\t<meta property=\"og:description\" content=\"If you want to add custom code to your site, you can use one of our action or filter hooks, add the code at the end of your theme\u2019s functions.php file, or use one of the code snippets plugins. Using a custom code plugin can be a better option for a few reasons: You get\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/memberpress.com\/wp-content\/uploads\/2022\/10\/mp-icon-RGB_Icon-01.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/memberpress.com\/wp-content\/uploads\/2022\/10\/mp-icon-RGB_Icon-01.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"1650\" \/>\n\t\t<meta property=\"og:image:height\" content=\"1275\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2024-02-13T14:50:41+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2024-02-13T22:17:41+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/memberpress\/\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@memberpress\" \/>\n\t\t<meta name=\"twitter:title\" content=\"How to add custom code snippets in WPCode | MemberPress\" \/>\n\t\t<meta name=\"twitter:description\" content=\"If you want to add custom code to your site, you can use one of our action or filter hooks, add the code at the end of your theme\u2019s functions.php file, or use one of the code snippets plugins. Using a custom code plugin can be a better option for a few reasons: You get\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/memberpress.com\/wp-content\/uploads\/2022\/10\/mp-icon-RGB_Icon-01.jpg\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/#article\",\"name\":\"How to add custom code snippets in WPCode | MemberPress\",\"headline\":\"How to add custom code snippets in WPCode\",\"author\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/blog\\\/author\\\/nikolacaseproof-com\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/memberpress.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/file-deUhYLoPgS.png\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/#articleImage\",\"width\":1265,\"height\":1266},\"datePublished\":\"2024-02-13T09:50:41-05:00\",\"dateModified\":\"2024-02-13T17:17:41-05:00\",\"inLanguage\":\"pt-BR\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/#webpage\"},\"articleSection\":\"Using Custom Codes\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/memberpress.com\\\/pt\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/doc-categories\\\/advanced-topics\\\/#listItem\",\"name\":\"Advanced Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/doc-categories\\\/advanced-topics\\\/#listItem\",\"position\":2,\"name\":\"Advanced Topics\",\"item\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/doc-categories\\\/advanced-topics\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/doc-categories\\\/using-custom-codes\\\/#listItem\",\"name\":\"Using Custom Codes\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/doc-categories\\\/using-custom-codes\\\/#listItem\",\"position\":3,\"name\":\"Using Custom Codes\",\"item\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/doc-categories\\\/using-custom-codes\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/#listItem\",\"name\":\"How to add custom code snippets in WPCode\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/doc-categories\\\/advanced-topics\\\/#listItem\",\"name\":\"Advanced Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/#listItem\",\"position\":4,\"name\":\"How to add custom code snippets in WPCode\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/doc-categories\\\/using-custom-codes\\\/#listItem\",\"name\":\"Using Custom Codes\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/#organization\",\"name\":\"MemberPress\",\"description\":\"The All-In-One WordPress Membership Plugin\",\"url\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/memberpress.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/mp-icon-RGB_Icon-01.jpg\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/#organizationLogo\",\"width\":1650,\"height\":1275,\"caption\":\"memberpress logo icon\"},\"image\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/#organizationLogo\"},\"sameAs\":[\"https:\\\/\\\/www.instagram.com\\\/memberpress\\\/\",\"https:\\\/\\\/www.pinterest.com\\\/memberpressplugin\\\/\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/MemberPressPlugin\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/memberpress\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/blog\\\/author\\\/nikolacaseproof-com\\\/#author\",\"url\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/blog\\\/author\\\/nikolacaseproof-com\\\/\",\"name\":\"Nikola M\",\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/memberpress.com\\\/wp-content\\\/litespeed\\\/avatar\\\/1edf820c48f9c430f380efe81887b154.jpg?ver=1775745920\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/#webpage\",\"url\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/\",\"name\":\"How to add custom code snippets in WPCode | MemberPress\",\"description\":\"If you want to add custom code to your site, you can use one of our action or filter hooks, add the code at the end of your theme\\u2019s functions.php file, or use one of the code snippets plugins. Using a custom code plugin can be a better option for a few reasons: You get\",\"inLanguage\":\"pt-BR\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/blog\\\/author\\\/nikolacaseproof-com\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/blog\\\/author\\\/nikolacaseproof-com\\\/#author\"},\"datePublished\":\"2024-02-13T09:50:41-05:00\",\"dateModified\":\"2024-02-13T17:17:41-05:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/#website\",\"url\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/\",\"name\":\"MemberPress\",\"description\":\"The All-In-One WordPress Membership Plugin\",\"inLanguage\":\"pt-BR\",\"publisher\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/pt\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO Pro -->\r\n\t\t<title>How to add custom code snippets in WPCode | MemberPress<\/title>\n\n","aioseo_head_json":{"title":"Como adicionar trechos de c\u00f3digo personalizados no WPCode | MemberPress","description":"Se quiser adicionar c\u00f3digo personalizado ao seu site, voc\u00ea pode usar um de nossos ganchos de a\u00e7\u00e3o ou filtro, adicionar o c\u00f3digo no final do arquivo functions.php do seu tema ou usar um dos plug-ins de snippets de c\u00f3digo. O uso de um plug-in de c\u00f3digo personalizado pode ser uma op\u00e7\u00e3o melhor por alguns motivos: Voc\u00ea obt\u00e9m","canonical_url":"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/#article","name":"How to add custom code snippets in WPCode | MemberPress","headline":"How to add custom code snippets in WPCode","author":{"@id":"https:\/\/memberpress.com\/pt\/blog\/author\/nikolacaseproof-com\/#author"},"publisher":{"@id":"https:\/\/memberpress.com\/pt\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/memberpress.com\/wp-content\/uploads\/2024\/02\/file-deUhYLoPgS.png","@id":"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/#articleImage","width":1265,"height":1266},"datePublished":"2024-02-13T09:50:41-05:00","dateModified":"2024-02-13T17:17:41-05:00","inLanguage":"pt-BR","mainEntityOfPage":{"@id":"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/#webpage"},"isPartOf":{"@id":"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/#webpage"},"articleSection":"Using Custom Codes"},{"@type":"BreadcrumbList","@id":"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/memberpress.com\/pt#listItem","position":1,"name":"Home","item":"https:\/\/memberpress.com\/pt","nextItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/pt\/doc-categories\/advanced-topics\/#listItem","name":"Advanced Topics"}},{"@type":"ListItem","@id":"https:\/\/memberpress.com\/pt\/doc-categories\/advanced-topics\/#listItem","position":2,"name":"Advanced Topics","item":"https:\/\/memberpress.com\/pt\/doc-categories\/advanced-topics\/","nextItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/pt\/doc-categories\/using-custom-codes\/#listItem","name":"Using Custom Codes"},"previousItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/pt#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/memberpress.com\/pt\/doc-categories\/using-custom-codes\/#listItem","position":3,"name":"Using Custom Codes","item":"https:\/\/memberpress.com\/pt\/doc-categories\/using-custom-codes\/","nextItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/#listItem","name":"How to add custom code snippets in WPCode"},"previousItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/pt\/doc-categories\/advanced-topics\/#listItem","name":"Advanced Topics"}},{"@type":"ListItem","@id":"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/#listItem","position":4,"name":"How to add custom code snippets in WPCode","previousItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/pt\/doc-categories\/using-custom-codes\/#listItem","name":"Using Custom Codes"}}]},{"@type":"Organization","@id":"https:\/\/memberpress.com\/pt\/#organization","name":"MemberPress","description":"The All-In-One WordPress Membership Plugin","url":"https:\/\/memberpress.com\/pt\/","logo":{"@type":"ImageObject","url":"https:\/\/memberpress.com\/wp-content\/uploads\/2022\/10\/mp-icon-RGB_Icon-01.jpg","@id":"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/#organizationLogo","width":1650,"height":1275,"caption":"memberpress logo icon"},"image":{"@id":"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/#organizationLogo"},"sameAs":["https:\/\/www.instagram.com\/memberpress\/","https:\/\/www.pinterest.com\/memberpressplugin\/","https:\/\/www.youtube.com\/c\/MemberPressPlugin","https:\/\/www.linkedin.com\/company\/memberpress\/"]},{"@type":"Person","@id":"https:\/\/memberpress.com\/pt\/blog\/author\/nikolacaseproof-com\/#author","url":"https:\/\/memberpress.com\/pt\/blog\/author\/nikolacaseproof-com\/","name":"Nikola M","image":{"@type":"ImageObject","url":"https:\/\/memberpress.com\/wp-content\/litespeed\/avatar\/1edf820c48f9c430f380efe81887b154.jpg?ver=1775745920"}},{"@type":"WebPage","@id":"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/#webpage","url":"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/","name":"How to add custom code snippets in WPCode | MemberPress","description":"If you want to add custom code to your site, you can use one of our action or filter hooks, add the code at the end of your theme\u2019s functions.php file, or use one of the code snippets plugins. Using a custom code plugin can be a better option for a few reasons: You get","inLanguage":"pt-BR","isPartOf":{"@id":"https:\/\/memberpress.com\/pt\/#website"},"breadcrumb":{"@id":"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/#breadcrumblist"},"author":{"@id":"https:\/\/memberpress.com\/pt\/blog\/author\/nikolacaseproof-com\/#author"},"creator":{"@id":"https:\/\/memberpress.com\/pt\/blog\/author\/nikolacaseproof-com\/#author"},"datePublished":"2024-02-13T09:50:41-05:00","dateModified":"2024-02-13T17:17:41-05:00"},{"@type":"WebSite","@id":"https:\/\/memberpress.com\/pt\/#website","url":"https:\/\/memberpress.com\/pt\/","name":"MemberPress","description":"The All-In-One WordPress Membership Plugin","inLanguage":"pt-BR","publisher":{"@id":"https:\/\/memberpress.com\/pt\/#organization"}}]},"og:locale":"pt_BR","og:site_name":"MemberPress","og:type":"article","og:title":"How to add custom code snippets in WPCode | MemberPress","og:description":"If you want to add custom code to your site, you can use one of our action or filter hooks, add the code at the end of your theme\u2019s functions.php file, or use one of the code snippets plugins. Using a custom code plugin can be a better option for a few reasons: You get","og:url":"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/","og:image":"https:\/\/memberpress.com\/wp-content\/uploads\/2022\/10\/mp-icon-RGB_Icon-01.jpg","og:image:secure_url":"https:\/\/memberpress.com\/wp-content\/uploads\/2022\/10\/mp-icon-RGB_Icon-01.jpg","og:image:width":1650,"og:image:height":1275,"article:published_time":"2024-02-13T14:50:41+00:00","article:modified_time":"2024-02-13T22:17:41+00:00","article:publisher":"https:\/\/www.facebook.com\/memberpress\/","twitter:card":"summary_large_image","twitter:site":"@memberpress","twitter:title":"How to add custom code snippets in WPCode | MemberPress","twitter:description":"If you want to add custom code to your site, you can use one of our action or filter hooks, add the code at the end of your theme\u2019s functions.php file, or use one of the code snippets plugins. Using a custom code plugin can be a better option for a few reasons: You get","twitter:image":"https:\/\/memberpress.com\/wp-content\/uploads\/2022\/10\/mp-icon-RGB_Icon-01.jpg"},"aioseo_meta_data":{"post_id":"62539","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2025-10-09 22:05:05","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"open_ai":null,"ai":null,"created":"2024-02-13 14:50:42","updated":"2026-03-03 14:52:42"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t<a href=\"https:\/\/memberpress.com\/pt\" title=\"Home\">Home<\/a>\n<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t<a href=\"https:\/\/memberpress.com\/pt\/doc-categories\/advanced-topics\/\" title=\"Advanced Topics\">Advanced Topics<\/a>\n<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t<a href=\"https:\/\/memberpress.com\/pt\/doc-categories\/using-custom-codes\/\" title=\"Using Custom Codes\">Using Custom Codes<\/a>\n<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\tHow to add custom code snippets in WPCode\n<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/memberpress.com\/pt"},{"label":"Advanced Topics","link":"https:\/\/memberpress.com\/pt\/doc-categories\/advanced-topics\/"},{"label":"Using Custom Codes","link":"https:\/\/memberpress.com\/pt\/doc-categories\/using-custom-codes\/"},{"label":"How to add custom code snippets in WPCode","link":"https:\/\/memberpress.com\/pt\/docs\/how-to-add-custom-code-snippets-in-wpcode\/"}],"_links":{"self":[{"href":"https:\/\/memberpress.com\/pt\/wp-json\/wp\/v2\/ht-kb\/62539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/memberpress.com\/pt\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/memberpress.com\/pt\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/memberpress.com\/pt\/wp-json\/wp\/v2\/users\/62252"}],"replies":[{"embeddable":true,"href":"https:\/\/memberpress.com\/pt\/wp-json\/wp\/v2\/comments?post=62539"}],"version-history":[{"count":0,"href":"https:\/\/memberpress.com\/pt\/wp-json\/wp\/v2\/ht-kb\/62539\/revisions"}],"wp:attachment":[{"href":"https:\/\/memberpress.com\/pt\/wp-json\/wp\/v2\/media?parent=62539"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/memberpress.com\/pt\/wp-json\/wp\/v2\/ht-kb-category?post=62539"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/memberpress.com\/pt\/wp-json\/wp\/v2\/ht-kb-tag?post=62539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}