{"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\/es\/docs\/how-to-add-custom-code-snippets-in-wpcode\/","title":{"rendered":"C\u00f3mo a\u00f1adir fragmentos de c\u00f3digo personalizados en WPCode"},"content":{"rendered":"<p>Si desea a\u00f1adir c\u00f3digo personalizado a su sitio web, puede utilizar uno de nuestros productos <a href=\"https:\/\/memberpress.com\/es\/docs\/action-hooks-in-memberpress\/\" target=\"_blank\" rel=\"noopener\">acci\u00f3n<\/a> o <a href=\"https:\/\/memberpress.com\/es\/docs\/filter-hooks-in-memberpress\/\" target=\"_blank\" rel=\"noopener\">filtro<\/a> a\u00f1ada el c\u00f3digo al final del archivo functions.php de su tema, o utilice uno de los comandos <b>fragmentos de c\u00f3digo plugins<\/b>.<\/p><p>Utilizar un plugin de c\u00f3digo personalizado puede ser una mejor opci\u00f3n por varias razones:<\/p><ul><li>M\u00e1s control sobre los fragmentos<\/li><li>Puedes activarlos si lo necesitas<\/li><li>Puede evitar posibles errores<\/li><li>Puede utilizarlos en el backend, front-end o s\u00f3lo en p\u00e1ginas espec\u00edficas<\/li><li>Muchos, como WPCode, no requieren conocimientos de programaci\u00f3n.<\/li><\/ul><p>En este documento, le mostraremos c\u00f3mo utilizar <a href=\"https:\/\/wordpress.org\/plugins\/insert-headers-and-footers\/\" target=\"_blank\" rel=\"noopener\">WPCode \u2013 Insert Headers and Footers + Custom Code Snippets<\/a> con MemberPress.<\/p><h2>Tutorial en v\u00eddeo<\/h2><iframe width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/mDYQU3TK_aQ?enablejsapi=1\" title=\"Reproductor de v\u00eddeo YouTube\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen=\"\"><\/iframe><p>Una vez que instales y actives el plugin WPCode en la secci\u00f3n de plugins, notar\u00e1s una secci\u00f3n de Code Snippets en el Dashboard de 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 a\u00f1adir fragmentos de c\u00f3digo, primero haga clic en el bot\u00f3n A\u00f1adir nuevo de la parte superior de la secci\u00f3n Fragmentos de c\u00f3digo.<\/p><p>Aparecer\u00e1 una nueva ventana A\u00f1adir fragmento.<\/p><p>A continuaci\u00f3n, sit\u00faese sobre la secci\u00f3n \"A\u00f1ada su c\u00f3digo personalizado (nuevo fragmento)\" y haga clic en el bot\u00f3n Utilizar fragmento.<\/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>En la nueva ventana, tienes que<\/p><ol><li>A\u00f1adir un t\u00edtulo<\/li><li>Cambie el tipo de c\u00f3digo a PHP Snippet (para que se compruebe si hay errores en la sintaxis de su c\u00f3digo)<\/li><li>A\u00f1ada su fragmento de c\u00f3digo en el campo \"Vista previa del c\u00f3digo\".<\/li><li>Aseg\u00farese de que la opci\u00f3n \"Insertar autom\u00e1ticamente\" est\u00e1 seleccionada.<\/li><li>Marque la casilla \"Inactivo\" para convertirla en \"Activo\".<\/li><li>Cambiar la ubicaci\u00f3n a \"S\u00f3lo Frontend\"<\/li><li>Haga clic en el bot\u00f3n \"Guardar fragmento\" para guardar el fragmento 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>Ya est\u00e1. Tu fragmento de c\u00f3digo deber\u00eda funcionar.<\/p><p>Activar y desactivar fragmentos de c\u00f3digo es f\u00e1cil. Todo lo que tiene que hacer es marcar\/desmarcar las casillas bajo la columna Estado en la tabla Fragmentos de c\u00f3digo.<\/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>La ubicaci\u00f3n donde se ejecutar\u00e1 el fragmento de c\u00f3digo<\/h3><p>En el ejemplo anterior, hemos utilizado la funci\u00f3n <a href=\"https:\/\/memberpress.com\/es\/docs\/filter-hooks-in-memberpress\/#mepr-account-nav-home-label\" target=\"_blank\" rel=\"noopener\">mepr-account-nav-home-label<\/a> para cambiar la etiqueta Inicio en la p\u00e1gina Cuenta del frontend.<\/p><p>Por lo tanto, utilizamos \"Frontend Only\" como Ubicaci\u00f3n. Esto significa que el fragmento de c\u00f3digo se ejecutar\u00e1 \u00fanicamente en el frontend (es decir, en todas las p\u00e1ginas a las que tengan acceso los usuarios normales, incluida la p\u00e1gina Cuenta).<\/p><p>Tambi\u00e9n podr\u00edamos utilizar la opci\u00f3n \"Run Everywhere\". De esta forma, el c\u00f3digo se ejecutar\u00eda en todo el sitio, incluido el panel de WordPress (el backend).<\/p><p>Si desea utilizar uno de los ganchos de filtro que se ejecutan s\u00f3lo en el backend (por ejemplo, <a href=\"https:\/\/memberpress.com\/es\/docs\/filter-hooks-in-memberpress\/#mepr-admin-subscriptions-cols\" target=\"_blank\" rel=\"noopener\">mepr-admin-subscriptions-cols<\/a>), puede utilizar la opci\u00f3n \"S\u00f3lo administradores\" desde Ubicaci\u00f3n.<\/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>Tenga en cuenta que WPCode tiene otras opciones para ejecutar fragmentos de c\u00f3digo. Por ejemplo, podr\u00eda ejecutarlos solo para usuarios que hayan iniciado sesi\u00f3n, p\u00e1ginas espec\u00edficas o para usuarios que tengan un rol seleccionado. <\/p><p>Para ello, marque la casilla \"Activar l\u00f3gica\" en la secci\u00f3n \"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>Integraci\u00f3n de WPCode Snippets Pro con MemberPress<\/h2><p>Si utiliza WPCode Snippets Pro podr\u00e1 controlar adicionalmente d\u00f3nde y en qu\u00e9 casos se ejecutar\u00e1n sus fragmentos de c\u00f3digo en funci\u00f3n de la ubicaci\u00f3n y las condiciones de MemberPress. Adem\u00e1s, puede a\u00f1adir sus p\u00edxeles de conversi\u00f3n para realizar un seguimiento de sus compras MemberPress.<\/p><p>Consulte los siguientes documentos espec\u00edficos:<\/p><ul><li><a href=\"https:\/\/memberpress.com\/es\/docs\/wpcode-locations-for-memberpress\/\" target=\"_blank\" rel=\"noopener\">WPCode Auto-Insert Locations para MemberPress<\/a><\/li><li><a href=\"https:\/\/memberpress.com\/es\/docs\/wpcode-conditional-logic-for-memberpress\/\" target=\"_blank\" rel=\"noopener\">Reglas de l\u00f3gica condicional WPCode para MemberPress<\/a><\/li><li><a href=\"https:\/\/memberpress.com\/es\/docs\/wpcode-conversion-pixels-with-memberpress\/\" target=\"_blank\" rel=\"noopener\">Utilice p\u00edxeles de conversi\u00f3n WPCode con 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>\u00bfAyuda?<\/h2><p>\u00bfNo funciona como crees que deber\u00eda, incluso despu\u00e9s de seguir las instrucciones? No dudes en enviarnos un <a href=\"https:\/\/memberpress.com\/es\/support\/\"><b>Ticket de asistencia<\/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\/es\/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=\"es_ES\" \/>\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\/es\/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\\\/es\\\/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\\\/es\\\/blog\\\/author\\\/nikolacaseproof-com\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/memberpress.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/file-deUhYLoPgS.png\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/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\":\"es-ES\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/#webpage\"},\"articleSection\":\"Using Custom Codes\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/es#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/memberpress.com\\\/es\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/doc-categories\\\/advanced-topics\\\/#listItem\",\"name\":\"Advanced Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/doc-categories\\\/advanced-topics\\\/#listItem\",\"position\":2,\"name\":\"Advanced Topics\",\"item\":\"https:\\\/\\\/memberpress.com\\\/es\\\/doc-categories\\\/advanced-topics\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/doc-categories\\\/using-custom-codes\\\/#listItem\",\"name\":\"Using Custom Codes\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/es#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/doc-categories\\\/using-custom-codes\\\/#listItem\",\"position\":3,\"name\":\"Using Custom Codes\",\"item\":\"https:\\\/\\\/memberpress.com\\\/es\\\/doc-categories\\\/using-custom-codes\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/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\\\/es\\\/doc-categories\\\/advanced-topics\\\/#listItem\",\"name\":\"Advanced Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/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\\\/es\\\/doc-categories\\\/using-custom-codes\\\/#listItem\",\"name\":\"Using Custom Codes\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/#organization\",\"name\":\"MemberPress\",\"description\":\"The All-In-One WordPress Membership Plugin\",\"url\":\"https:\\\/\\\/memberpress.com\\\/es\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/memberpress.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/mp-icon-RGB_Icon-01.jpg\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/#organizationLogo\",\"width\":1650,\"height\":1275,\"caption\":\"memberpress logo icon\"},\"image\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/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\\\/es\\\/blog\\\/author\\\/nikolacaseproof-com\\\/#author\",\"url\":\"https:\\\/\\\/memberpress.com\\\/es\\\/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\\\/es\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/#webpage\",\"url\":\"https:\\\/\\\/memberpress.com\\\/es\\\/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\":\"es-ES\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/docs\\\/how-to-add-custom-code-snippets-in-wpcode\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/blog\\\/author\\\/nikolacaseproof-com\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/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\\\/es\\\/#website\",\"url\":\"https:\\\/\\\/memberpress.com\\\/es\\\/\",\"name\":\"MemberPress\",\"description\":\"The All-In-One WordPress Membership Plugin\",\"inLanguage\":\"es-ES\",\"publisher\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/es\\\/#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":"C\u00f3mo a\u00f1adir fragmentos de c\u00f3digo personalizados en WPCode | MemberPress","description":"Si quieres a\u00f1adir c\u00f3digo personalizado a tu sitio, puedes utilizar uno de nuestros ganchos de acci\u00f3n o filtro, a\u00f1adir el c\u00f3digo al final del archivo functions.php de tu tema o utilizar uno de los plugins de fragmentos de c\u00f3digo. Utilizar un plugin de c\u00f3digo personalizado puede ser una mejor opci\u00f3n por varias razones: Obtienes","canonical_url":"https:\/\/memberpress.com\/es\/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\/es\/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\/es\/blog\/author\/nikolacaseproof-com\/#author"},"publisher":{"@id":"https:\/\/memberpress.com\/es\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/memberpress.com\/wp-content\/uploads\/2024\/02\/file-deUhYLoPgS.png","@id":"https:\/\/memberpress.com\/es\/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":"es-ES","mainEntityOfPage":{"@id":"https:\/\/memberpress.com\/es\/docs\/how-to-add-custom-code-snippets-in-wpcode\/#webpage"},"isPartOf":{"@id":"https:\/\/memberpress.com\/es\/docs\/how-to-add-custom-code-snippets-in-wpcode\/#webpage"},"articleSection":"Using Custom Codes"},{"@type":"BreadcrumbList","@id":"https:\/\/memberpress.com\/es\/docs\/how-to-add-custom-code-snippets-in-wpcode\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/memberpress.com\/es#listItem","position":1,"name":"Home","item":"https:\/\/memberpress.com\/es","nextItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/es\/doc-categories\/advanced-topics\/#listItem","name":"Advanced Topics"}},{"@type":"ListItem","@id":"https:\/\/memberpress.com\/es\/doc-categories\/advanced-topics\/#listItem","position":2,"name":"Advanced Topics","item":"https:\/\/memberpress.com\/es\/doc-categories\/advanced-topics\/","nextItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/es\/doc-categories\/using-custom-codes\/#listItem","name":"Using Custom Codes"},"previousItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/es#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/memberpress.com\/es\/doc-categories\/using-custom-codes\/#listItem","position":3,"name":"Using Custom Codes","item":"https:\/\/memberpress.com\/es\/doc-categories\/using-custom-codes\/","nextItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/es\/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\/es\/doc-categories\/advanced-topics\/#listItem","name":"Advanced Topics"}},{"@type":"ListItem","@id":"https:\/\/memberpress.com\/es\/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\/es\/doc-categories\/using-custom-codes\/#listItem","name":"Using Custom Codes"}}]},{"@type":"Organization","@id":"https:\/\/memberpress.com\/es\/#organization","name":"MemberPress","description":"The All-In-One WordPress Membership Plugin","url":"https:\/\/memberpress.com\/es\/","logo":{"@type":"ImageObject","url":"https:\/\/memberpress.com\/wp-content\/uploads\/2022\/10\/mp-icon-RGB_Icon-01.jpg","@id":"https:\/\/memberpress.com\/es\/docs\/how-to-add-custom-code-snippets-in-wpcode\/#organizationLogo","width":1650,"height":1275,"caption":"memberpress logo icon"},"image":{"@id":"https:\/\/memberpress.com\/es\/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\/es\/blog\/author\/nikolacaseproof-com\/#author","url":"https:\/\/memberpress.com\/es\/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\/es\/docs\/how-to-add-custom-code-snippets-in-wpcode\/#webpage","url":"https:\/\/memberpress.com\/es\/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":"es-ES","isPartOf":{"@id":"https:\/\/memberpress.com\/es\/#website"},"breadcrumb":{"@id":"https:\/\/memberpress.com\/es\/docs\/how-to-add-custom-code-snippets-in-wpcode\/#breadcrumblist"},"author":{"@id":"https:\/\/memberpress.com\/es\/blog\/author\/nikolacaseproof-com\/#author"},"creator":{"@id":"https:\/\/memberpress.com\/es\/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\/es\/#website","url":"https:\/\/memberpress.com\/es\/","name":"MemberPress","description":"The All-In-One WordPress Membership Plugin","inLanguage":"es-ES","publisher":{"@id":"https:\/\/memberpress.com\/es\/#organization"}}]},"og:locale":"es_ES","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\/es\/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\/es\" title=\"Home\">Home<\/a>\n<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t<a href=\"https:\/\/memberpress.com\/es\/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\/es\/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\/es"},{"label":"Advanced Topics","link":"https:\/\/memberpress.com\/es\/doc-categories\/advanced-topics\/"},{"label":"Using Custom Codes","link":"https:\/\/memberpress.com\/es\/doc-categories\/using-custom-codes\/"},{"label":"How to add custom code snippets in WPCode","link":"https:\/\/memberpress.com\/es\/docs\/how-to-add-custom-code-snippets-in-wpcode\/"}],"_links":{"self":[{"href":"https:\/\/memberpress.com\/es\/wp-json\/wp\/v2\/ht-kb\/62539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/memberpress.com\/es\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/memberpress.com\/es\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/memberpress.com\/es\/wp-json\/wp\/v2\/users\/62252"}],"replies":[{"embeddable":true,"href":"https:\/\/memberpress.com\/es\/wp-json\/wp\/v2\/comments?post=62539"}],"version-history":[{"count":0,"href":"https:\/\/memberpress.com\/es\/wp-json\/wp\/v2\/ht-kb\/62539\/revisions"}],"wp:attachment":[{"href":"https:\/\/memberpress.com\/es\/wp-json\/wp\/v2\/media?parent=62539"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/memberpress.com\/es\/wp-json\/wp\/v2\/ht-kb-category?post=62539"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/memberpress.com\/es\/wp-json\/wp\/v2\/ht-kb-tag?post=62539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}