{"id":23747,"date":"2018-01-08T00:00:00","date_gmt":"2018-01-07T18:30:00","guid":{"rendered":"https:\/\/git-staging.wpastra.com\/?post_type=docs&#038;p=23747"},"modified":"2023-12-10T19:52:24","modified_gmt":"2023-12-10T14:22:24","slug":"add-custom-php-code","status":"publish","type":"docs","link":"https:\/\/git-staging.wpastra.com\/es\/docs\/add-custom-php-code\/","title":{"rendered":"\u00bfC\u00f3mo a\u00f1adir c\u00f3digo PHP personalizado?"},"content":{"rendered":"<p>En muchos casos, necesitar\u00e1 a\u00f1adir c\u00f3digo PHP personalizado al tema. En este art\u00edculo, vamos a explicar algunas maneras de c\u00f3mo puede hacerlo:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"1-custom-layouts-module-in-astra-pro-easiest\"><strong>1. M\u00f3dulo Site Builder en Astra Pro (M\u00e1s f\u00e1cil)<\/strong><\/h4>\n\n\n\n<p><a aria-label=\"Astra Pro Addon (se abre en una nueva pesta\u00f1a)\" href=\"https:\/\/git-staging.wpastra.com\/es\/docs\/getting-started-with-astra-pro\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Complemento Astra Pro<\/strong><\/a> es un plugin premium que ampl\u00eda las caracter\u00edsticas del tema Astra. Si ha adquirido Astra Pro Addon, utilice el bot\u00f3n <a href=\"https:\/\/git-staging.wpastra.com\/es\/docs\/site-builder\/\" data-type=\"link\" data-id=\"https:\/\/git-staging.wpastra.com\/docs\/site-builder\/\">M\u00f3dulo Site Builder<\/a> para a\u00f1adir c\u00f3digo PHP personalizado. A continuaci\u00f3n se presentan los pasos que muestran c\u00f3mo agregar c\u00f3digo -.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/git-staging.wpastra.com\/es\/docs\/site-builder\/\" data-type=\"link\" data-id=\"https:\/\/git-staging.wpastra.com\/docs\/site-builder\/\">Activar<\/a> el m\u00f3dulo Site Builder de Astra Pro.<\/li>\n\n\n\n<li>Inserte el c\u00f3digo en el campo <span style=\"text-decoration: underline;\">Editor de c\u00f3digo<\/span>.<\/li>\n\n\n\n<li>Seleccione <a href=\"https:\/\/git-staging.wpastra.com\/es\/docs\/custom-layout-hooks\/\">Ganchos<\/a> y elija la acci\u00f3n adecuada \/ <strong>wp_head<\/strong> acci\u00f3n.<\/li>\n\n\n\n<li>Elija mostrarlo en todo el sitio web<\/li>\n\n\n\n<li>Publique la maqueta.<\/li>\n<\/ol>\n\n\n\n<p><a href=\"https:\/\/git-staging.wpastra.com\/es\/docs\/how-to-add-google-analytics-code-with-custom-layouts-module\/\" target=\"_blank\" rel=\"noopener noreferrer\">Aqu\u00ed<\/a> es un ejemplo que muestra c\u00f3mo a\u00f1adir c\u00f3digo de Google Analytics. Del mismo modo, puede a\u00f1adir cualquier c\u00f3digo personalizado.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"2-with-third-party-plugin\"><strong>2. Con plugin de terceros<\/strong><\/h4>\n\n\n\n<p>Hay plugins gratuitos disponibles en el repositorio de WordPress que puede utilizar para a\u00f1adir c\u00f3digo PHP personalizado. A continuaci\u00f3n se presentan dos de ellos:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\/\">Fragmentos de c\u00f3digo<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/wordpress.org\/plugins\/my-custom-functions\/\">Mis funciones personalizadas<\/a><\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"3-in-child-theme\"><strong>3. En Child Theme<\/strong><\/h4>\n\n\n\n<p>Puede a\u00f1adir un filtro o c\u00f3digo PHP personalizado a trav\u00e9s del panel de WordPress, siga los pasos sobre c\u00f3mo puede hacer lo mismo -<\/p>\n\n\n\n<p><strong>Paso 1:<\/strong> Instale y active el tema hijo Astra. Si usted no est\u00e1 seguro, c\u00f3mo instalar el tema infantil, aqu\u00ed es un <a href=\"https:\/\/git-staging.wpastra.com\/es\/docs\/install-astra-child-theme\/\">art\u00edculo <\/a>que le guiar\u00e1n.<\/p>\n\n\n\n<p><strong>Segundo paso:<\/strong> Abra el Editor de temas en Apariencia. <a href=\"https:\/\/wordpress.org\/support\/topic\/editor-is-not-showing-2\/\">No se ve el Editor de temas, solucionar el mismo problema<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor.jpeg\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"495\" src=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor-1024x495.jpeg\" alt=\"ast-theme-editor\" class=\"wp-image-151159\" srcset=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor-1024x495.jpeg 1024w, https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor-300x145.jpeg 300w, https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor-768x371.jpeg 768w, https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor.jpeg 1346w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p><strong>Paso 3:<\/strong> Seleccione el tema hijo Astra en el desplegable y haga clic en Seleccionar para elegirlo. Navega hasta el functions.php del tema hijo, desde la secci\u00f3n de la derecha seleccionando functions.php.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor-child-theme.jpeg\"><img decoding=\"async\" width=\"1024\" height=\"419\" src=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor-child-theme-1024x419.jpeg\" alt=\"ast-theme-editor-child-theme\" class=\"wp-image-151160\" srcset=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor-child-theme-1024x419.jpeg 1024w, https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor-child-theme-300x123.jpeg 300w, https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor-child-theme-768x314.jpeg 768w, https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor-child-theme.jpeg 1171w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p><strong>Paso 4:<\/strong> A\u00f1ada su c\u00f3digo en la parte inferior del archivo y haga clic en Actualizar archivo en la parte inferior. <\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor-child-theme-ading-custom-code.jpeg\"><img decoding=\"async\" width=\"1024\" height=\"568\" src=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor-child-theme-ading-custom-code-1024x568.jpeg\" alt=\"ast-theme-editor-child-theme-ading-custom-code\" class=\"wp-image-151161\" srcset=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor-child-theme-ading-custom-code-1024x568.jpeg 1024w, https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor-child-theme-ading-custom-code-300x166.jpeg 300w, https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor-child-theme-ading-custom-code-768x426.jpeg 768w, https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor-child-theme-ading-custom-code.jpeg 1333w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p><strong>Nota:<\/strong> Si tiene el tema Padre activo y visita el Editor de temas, ver\u00e1 el siguiente mensaje, que le informa de que editar directamente su tema podr\u00eda bloquear su sitio web. Haga clic en \"Entiendo\".&nbsp;<\/p>\n\n\n\n<p>O si tiene acceso a <em>cPanel<\/em> de su sitio web, puede utilizar un software FTP como FileZilla. A continuaci\u00f3n se presentan los pasos que explican c\u00f3mo hacerlo -.<\/p>\n\n\n\n<p><strong>Paso 1:<\/strong> Instalar y activar el Astra <a href=\"https:\/\/git-staging.wpastra.com\/es\/docs\/install-astra-child-theme\/\">Ni\u00f1o <\/a>Tema desde el panel de control de WordPress.<\/p>\n\n\n\n<p><strong>Segundo paso:<\/strong> Abra su sitio WordPress a trav\u00e9s de FTP. Le recomendamos que utilice FileZilla.<\/p>\n\n\n\n<p><strong>Paso 3:<\/strong> Vaya a <em>wp-content &gt; temas &gt; astra-child<\/em><\/p>\n\n\n\n<p><strong>Paso 4:<\/strong> Haga clic con el bot\u00f3n derecho en functions.php y seleccione <a href=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2018\/01\/child-theme-ftp.png\">Ver\/Editar<\/a><\/p>\n\n\n\n<p><strong>Paso 5:<\/strong> A\u00f1ade tu c\u00f3digo al final del archivo y gu\u00e1rdalo.<\/p>","protected":false},"excerpt":{"rendered":"<p>En muchos casos, necesitar\u00e1 a\u00f1adir c\u00f3digo PHP personalizado al tema. En este art\u00edculo, vamos a explicar algunas maneras de c\u00f3mo puede hacerlo: 1. M\u00f3dulo Site Builder en Astra Pro (M\u00e1s f\u00e1cil) Astra Pro Addon es un plugin premium que ampl\u00eda las caracter\u00edsticas del tema Astra. Si ha adquirido Astra [...]<\/p>","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"docs_category":[2109],"docs_tag":[],"class_list":{"0":"post-23747","1":"docs","2":"type-docs","3":"status-publish","5":"docs_category-astra-theme-pro-filters"},"spectra_custom_meta":{"_wp_old_slug":[""],"_wp_page_template":["default"],"_edit_lock":["1702218403:89"],"_edit_last":["89"],"onesignal_meta_box_present":["1"],"onesignal_send_notification":[""],"site-sidebar-layout":["default"],"site-content-layout":["default"],"theme-transparent-header-meta":["default"],"_yoast_wpseo_content_score":["60"],"wpil_sync_report3":["1"],"wpil_links_inbound_internal_count":["29"],"wpil_links_inbound_internal_count_data":["a:29:{i:0;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:2:\"21\";s:6:\"anchor\";s:27:\"child theme's functions.php\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:39:\"How to Change the Default Astra Strings\";}i:1;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:3:\"100\";s:6:\"anchor\";s:27:\"child theme's functions.php\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:20:\"Using Hooks in Astra\";}i:2;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:3:\"738\";s:6:\"anchor\";s:27:\"child theme's functions.php\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:48:\"How to Update the &quot;Scroll To Top&quot; Icon\";}i:3;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:3:\"858\";s:6:\"anchor\";s:27:\"child theme's functions.php\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:40:\"Remove Primary Navigation Menu with Hook\";}i:4;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"22238\";s:6:\"anchor\";s:56:\"How to add custom code to child theme\u2019s functions.php?\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:54:\"What is a child theme and how to install it for Astra?\";}i:5;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"23947\";s:6:\"anchor\";s:27:\"child theme's functions.php\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:40:\"Change the Astra Header Breakpoint width\";}i:6;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"25176\";s:6:\"anchor\";s:27:\"child theme's functions.php\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:55:\"Disable loading Astra's default font file -  Astra.woff\";}i:7;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"25456\";s:6:\"anchor\";s:27:\"child theme's functions.php\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:61:\"How to Remove Previous and Next Link from a Single Blog Post?\";}i:8;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"25523\";s:6:\"anchor\";s:24:\"child theme's\u00a0style.css\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:52:\"How to display WooCommerce sidebar on top on mobile?\";}i:9;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"26203\";s:6:\"anchor\";s:27:\"How to Add Custom PHP Code?\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:57:\"How to Display \"Last Updated\" instead of \"Published\" Date\";}i:10;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"26321\";s:6:\"anchor\";s:23:\"How to add PHP Snippets\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:33:\"Disable Featured Image from Pages\";}i:11;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"28393\";s:6:\"anchor\";s:29:\"child theme\u2019s functions.php\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:56:\"How to Stick Footer to Bottom when Page Content is Less?\";}i:12;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"28461\";s:6:\"anchor\";s:11:\"PHP snippet\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:38:\"Change default colors in color palette\";}i:13;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"28842\";s:6:\"anchor\";s:27:\"child theme's functions.php\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:39:\"Color for Anchor Tag Inside Heading Tag\";}i:14;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"29199\";s:6:\"anchor\";s:41:\"the child theme\u2019s functions.php file.\u00a0\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:30:\"How to Disable Primary Header?\";}i:15;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"29269\";s:6:\"anchor\";s:23:\"child theme's style.css\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:25:\"Dim Content on Menu Hover\";}i:16;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"29517\";s:6:\"anchor\";s:32:\"child theme's functions.php file\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:36:\"Change WooCommerce Out of Stock text\";}i:17;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"30100\";s:6:\"anchor\";s:32:\"child theme's functions.php file\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:51:\"Display products from same category with navigation\";}i:18;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"30157\";s:6:\"anchor\";s:27:\"child theme's functions.php\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:39:\"Change Sidebar Widget Title Heading Tag\";}i:19;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"30747\";s:6:\"anchor\";s:33:\" child theme's functions.php file\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:42:\"Disable Astra\u2019s Native AMP Functionality\";}i:20;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"31184\";s:6:\"anchor\";s:45:\"the child theme\u2019s functions.php file.&nbsp;\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:52:\"How to Switch From Existing Breadcrumb to New Trail?\";}i:21;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"31669\";s:6:\"anchor\";s:29:\"child theme\u2019s functions.php\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:35:\"How to Add RTL CSS via Child Theme?\";}i:22;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"31923\";s:6:\"anchor\";s:33:\"child theme's functions.php file.\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:49:\"Disable all meta settings of page\/post by default\";}i:23;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"31941\";s:6:\"anchor\";s:32:\"child theme's functions.php file\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:28:\"Remove Inline CSS from Astra\";}i:24;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"37131\";s:6:\"anchor\";s:32:\"child theme's functions.php file\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:26:\"How to Disable Page Title?\";}i:25;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"37556\";s:6:\"anchor\";s:32:\"child theme's functions.php file\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:32:\"Change HTML tag for Site Tagline\";}i:26;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"37558\";s:6:\"anchor\";s:32:\"child theme's functions.php file\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:34:\"Modify font-display Property Value\";}i:27;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"38503\";s:6:\"anchor\";s:40:\"&nbsp;child theme\u2019s functions.php file\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:35:\"Add revisions to the Custom Layouts\";}i:28;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";s:5:\"39392\";s:6:\"anchor\";s:32:\"child theme's functions.php file\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:54:\"How to Change the Heading Tag for the Page\/Post Titles\";}}"],"wpil_links_outbound_internal_count":["7"],"wpil_links_outbound_internal_count_data":["a:7:{i:0;a:9:{s:3:\"url\";s:68:\"https:\/\/git-staging.wpastra.com\/docs\/getting-started-with-astra-pro\/\";s:8:\"url_real\";s:68:\"https:\/\/git-staging.wpastra.com\/docs\/getting-started-with-astra-pro\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";i:0;s:6:\"anchor\";s:32:\"<strong>Astra Pro Addon<\/strong>\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:0:\"\";}i:1;a:9:{s:3:\"url\";s:56:\"https:\/\/git-staging.wpastra.com\/docs\/custom-layouts-pro\/\";s:8:\"url_real\";s:56:\"https:\/\/git-staging.wpastra.com\/docs\/custom-layouts-pro\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";i:0;s:6:\"anchor\";s:21:\"Custom Layouts module\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:0:\"\";}i:2;a:9:{s:3:\"url\";s:56:\"https:\/\/git-staging.wpastra.com\/docs\/custom-layouts-pro\/\";s:8:\"url_real\";s:56:\"https:\/\/git-staging.wpastra.com\/docs\/custom-layouts-pro\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";i:0;s:6:\"anchor\";s:8:\"Activate\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:0:\"\";}i:3;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/custom-layout-hooks\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/custom-layout-hooks\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";i:0;s:6:\"anchor\";s:5:\"Hooks\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:0:\"\";}i:4;a:9:{s:3:\"url\";s:97:\"https:\/\/git-staging.wpastra.com\/docs\/how-to-add-google-analytics-code-with-custom-layouts-module\/\";s:8:\"url_real\";s:97:\"https:\/\/git-staging.wpastra.com\/docs\/how-to-add-google-analytics-code-with-custom-layouts-module\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";i:0;s:6:\"anchor\";s:4:\"Here\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:0:\"\";}i:5;a:9:{s:3:\"url\";s:63:\"https:\/\/git-staging.wpastra.com\/docs\/install-astra-child-theme\/\";s:8:\"url_real\";s:63:\"https:\/\/git-staging.wpastra.com\/docs\/install-astra-child-theme\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";i:0;s:6:\"anchor\";s:5:\"Child\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:0:\"\";}i:6;a:9:{s:3:\"url\";s:78:\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2018\/01\/child-theme-ftp.png\";s:8:\"url_real\";s:78:\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2018\/01\/child-theme-ftp.png\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";i:0;s:6:\"anchor\";s:9:\"View\/Edit\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:0:\"\";}}"],"wpil_links_outbound_external_count":["2"],"wpil_links_outbound_external_count_data":["a:2:{i:0;a:9:{s:3:\"url\";s:44:\"https:\/\/wordpress.org\/plugins\/code-snippets\/\";s:8:\"url_real\";s:44:\"https:\/\/wordpress.org\/plugins\/code-snippets\/\";s:4:\"host\";s:13:\"wordpress.org\";s:9:\"host_real\";s:13:\"wordpress.org\";s:8:\"internal\";b:0;s:7:\"post_id\";i:0;s:6:\"anchor\";s:13:\"Code Snippets\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:0:\"\";}i:1;a:9:{s:3:\"url\";s:50:\"https:\/\/wordpress.org\/plugins\/my-custom-functions\/\";s:8:\"url_real\";s:50:\"https:\/\/wordpress.org\/plugins\/my-custom-functions\/\";s:4:\"host\";s:13:\"wordpress.org\";s:9:\"host_real\";s:13:\"wordpress.org\";s:8:\"internal\";b:0;s:7:\"post_id\";i:0;s:6:\"anchor\";s:19:\"My Custom Functions\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:0:\"\";}}"],"wpil_sync_report2_time":["2019-09-05T12:02:06+00:00"],"_ppc_meta_key":["a:8:{s:20:\"ppc_key5d92f85d42273\";s:60:\"Images &amp; Names Correctly. Title &amp; Alt Tags are Given\";s:8:\"ppc_key4\";s:15:\"Formatting Done\";s:8:\"ppc_key2\";s:23:\"Featured Image Assigned\";s:8:\"ppc_key3\";s:17:\"Category Selected\";s:8:\"ppc_key5\";s:15:\"Title is Catchy\";s:8:\"ppc_key7\";s:8:\"Done SEO\";s:8:\"ppc_key6\";s:22:\"Social Images Assigned\";s:8:\"ppc_key8\";s:28:\"Spelling and Grammar Checked\";}"],"tap_disable_autolinker":["no"],"tap_autolink_inside_heading":["global"],"tap_autolink_random_placement":["global"],"tap_post_autolinker_limit":["0"],"_yoast_wpseo_title":["How to Add Custom PHP Code in the Astra Theme?"],"wp_last_modified_info":["May 1, 2023 @ 9:21 AM"],"wplmi_shortcode":["[lmt-post-modified-info]"],"_yoast_wpseo_estimated-reading-time-minutes":["3"],"_ht_kb_post_views_count":["22"],"_ht_kb_usefulness":["0"],"_ht_article_order_103":["23747"],"views":["20938"],"helpful":["44"],"unhelpful":["57"],"redirects":["30"],"_lmt_disableupdate":["no"],"_wplmi_last_modified":["2023-05-01 09:21:54"],"rank_math_title":["How to Add Custom PHP Code in the Astra Theme?"],"rank_math_news_sitemap_robots":["index"],"rank_math_robots":["a:1:{i:0;s:5:\"index\";}"],"rank_math_analytic_object_id":["1282"],"rank_math_seo_score":["73"],"rank_math_internal_links_processed":["1"],"rank_math_primary_docs_category":["2109"],"rank_math_focus_keyword":["Custom PHP code"],"rank_math_og_content_image":["a:2:{s:5:\"check\";s:32:\"381f02e90c60930f6b689b8b763d7bf8\";s:6:\"images\";a:1:{i:0;s:89:\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2023\/05\/ast-theme-editor-1024x495.jpeg\";}}"],"_wpml_media_duplicate":["1"],"_uag_custom_page_level_css":[""],"ast-site-content-layout":["default"],"adv-header-id-meta":[""],"stick-header-meta":[""],"astra-migrate-meta-layouts":["set"],"pfd_related_docs":[""],"pfd_manual_related_docs":["1"],"_trp_automatically_translated_slug_es_ES":["anadir-codigo-php-personalizado"],"_uag_page_assets":["a:9:{s:3:\"css\";s:2495:\".wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape-top svg{width: calc( 100% + 1.3px );}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape.uagb-container__shape-top .uagb-container__shape-fill{fill: rgba(51,51,51,1);}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape-bottom svg{width: calc( 100% + 1.3px );}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape.uagb-container__shape-bottom .uagb-container__shape-fill{fill: rgba(51,51,51,1);}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__video-wrap video{opacity: 1;}.wp-block-uagb-container.uagb-is-root-container .uagb-block-debf2792{max-width: 100%;width: 100%;}.wp-block-uagb-container.uagb-is-root-container.alignfull.uagb-block-debf2792 > .uagb-container-inner-blocks-wrap{--inner-content-custom-width: min( 100%, 1200px);max-width: var(--inner-content-custom-width);width: 100%;flex-direction: column;align-items: center;justify-content: center;flex-wrap: nowrap;row-gap: 0px;column-gap: 0px;}.wp-block-uagb-container.uagb-block-debf2792{box-shadow: 0px 0px   #00000070 ;padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;margin-top: 0px !important;margin-bottom: 0px !important;margin-left: 0px;margin-right: 0px;overflow: visible;border-color: inherit;row-gap: 0px;column-gap: 0px;}@media only screen and (max-width: 976px) {.wp-block-uagb-container.uagb-is-root-container .uagb-block-debf2792{width: 100%;}.wp-block-uagb-container.uagb-is-root-container.alignfull.uagb-block-debf2792 > .uagb-container-inner-blocks-wrap{--inner-content-custom-width: min( 100%, 1024px);max-width: var(--inner-content-custom-width);width: 100%;}.wp-block-uagb-container.uagb-block-debf2792{padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;margin-top: 0px !important;margin-bottom: 0px !important;margin-left: 0px;margin-right: 0px;}}@media only screen and (max-width: 767px) {.wp-block-uagb-container.uagb-is-root-container .uagb-block-debf2792{max-width: 100%;width: 100%;}.wp-block-uagb-container.uagb-is-root-container.alignfull.uagb-block-debf2792 > .uagb-container-inner-blocks-wrap{--inner-content-custom-width: min( 100%, 767px);max-width: var(--inner-content-custom-width);width: 100%;flex-wrap: wrap;}.wp-block-uagb-container.uagb-block-debf2792{padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;margin-top: 0px !important;margin-bottom: 0px !important;margin-left: 0px;margin-right: 0px;}}\";s:2:\"js\";s:0:\"\";s:18:\"current_block_list\";a:7:{i:0;s:14:\"core\/paragraph\";i:1;s:12:\"core\/heading\";i:2;s:9:\"core\/list\";i:3;s:14:\"core\/list-item\";i:4;s:10:\"core\/image\";i:5;s:14:\"uagb\/container\";i:6;s:14:\"core\/shortcode\";}s:8:\"uag_flag\";b:1;s:11:\"uag_version\";s:10:\"1776983535\";s:6:\"gfonts\";a:0:{}s:10:\"gfonts_url\";s:0:\"\";s:12:\"gfonts_files\";a:0:{}s:14:\"uag_faq_layout\";b:0;}"]},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"trp-custom-language-flag":false},"uagb_author_info":{"display_name":"Sujay Pawar","author_link":"https:\/\/git-staging.wpastra.com\/es\/author\/sujay\/"},"uagb_comment_info":0,"uagb_excerpt":"In many cases, you will need to add custom PHP code to the theme. In this article, let us explain some ways how you can do so: 1. Site Builder module in Astra Pro (Easiest) Astra Pro Addon is a premium plugin that extends the features of the Astra theme. If you have purchased Astra&hellip;","_links":{"self":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs\/23747"}],"collection":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/comments?post=23747"}],"version-history":[{"count":0,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs\/23747\/revisions"}],"wp:attachment":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/media?parent=23747"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs_category?post=23747"},{"taxonomy":"docs_tag","embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs_tag?post=23747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}