Skip to main content




Hay muchas formas de actualizar un tema de WordPress, pero es fácil para ellos terminar con datos perdidos, por lo que debe saber cómo evitarlo. Hold. I have not customized my site yet. I don't need this item. In fact, you do; preparing in advance is the only way to ensure a truly smooth transition. If you've already customized your site, don't worry. It's not too late.

Aquí está el resumen: la mayoría de los desarrolladores aficionados simplemente entran en la style sheet de su sitio y comienzan a reorganizar las cosas. Eso está bien, hasta que actualice y desaparezca toda su minuciosa personalización. De hecho, si personaliza su sitio Web sin considerar cómo lo afectarán las actualizaciones, se encontrará con un mundo de dolor. Antes de considerar no actualizar su sitio y convertirlo en una práctica target para los piratas informáticos de todo el mundo, siga algunos de los consejos a continuación para integrar las personalizaciones en su proceso de actualización.

WordPress frameworks

La solución más común y popular para esto es Genesis Framework. Si alguna vez ha leído un Blog o un tutorial de WordPress, es muy probable que haya visto a un desarrollador entusiasmado con él (consulte la revisión completa de Génesis de Ren en nuestro blog).

Genesis is like a theme, but more. True to its name, it could be described as the basic template on which many themes are built, and they all come in the form of sub-themes that build an "exterior" on top of the framework. With Genesis, you can change and update your themes as much as you want without losing a single detail of your customization. At the same time it has some other desirable features, and it is worth taking a look at it. At this time it will cost you $ 60.

Otra alternativa es Total WordPress Theme Framework, que utiliza un enfoque equivalente. Total incluye opciones para temas secundarios a la vez de un campo CSS personalizado fácil de usar en el panel de administración que puede usar para agregar ajustes de estilo a su tema. A pesar de todo, si no tienes el presupuesto para ello, o has encontrado otro tema que te gusta y no planeas renunciar a él, todavía hay alternativas.

WordPress plugins

wp-template-overrides-wordpress-plugin-8473785

There are a host of plugins that can help you ease the update process. Most of them are designed to be used before you start customizing them, but if you've already done so, they might come in handy in the future.

The WP Template Overrides plugin It will allow you to quickly override any template. If you don't feel like doing all of the above, you can use a plugin called One click child theme to do it from the WordPress dashboard, offering the best of both worlds.

WordPress Kids Themes

La forma más común de realizar personalizaciones estables, y la más recomendada, es con un tema hijo. Para aclarar, un tema hijo se parece mucho a una capa de Photoshop o una celda de animación: una hoja de estilo transparente que le posibilita realizar cambios de forma no destructiva. No solo cambios cosméticos, es aún más importante incluir modificaciones importantes en las funciones esenciales del sitio en un tema hijo.

Modifying your site functions.php file is one of the worst things you can do before an upgrade, as the loss of an important functional component can essentially bring out the support beams underneath your website. Therefore, include functional changes in the child theme at the same time. It can be useful to create several to avoid having to dump too much information into one. In case you need a refresher, they are pretty simple to create. After that, you just need to include the things from the child theme that you specifically want to change.

First, create a new folder in the wp-content / themes directory to contain it. Give it the same name as the main theme, but with "-child" studded at the end (you can really call it whatever you want, but by naming it this way if you ever have multiple child themes, you know what they're for). In the folder, create a file called "style.css". After that, the stylesheet should start with the following code:

/*
Theme Name: Total Child
Theme URI: http://totalwptheme.com
Description: Total WordPress theme example child theme.
Author: AJ Clarke
Author URI: http://totalwptheme.com
Template: Total
Version: 1.0
*/

Any of the input fields can be changed however you see fit, but be sure to keep the theme name and template. The template is the directory name of the parent theme, and if the template name is missing or incorrect, the child theme will not be displayed.

Next you want to create a new empty function.php file where you will add code so your child theme knows to include your theme's main stylesheet. In this functions.php file paste the following code:

<?php
// Load parent theme stylesheet
function total_child_enqueue_parent_theme_style() {
	// Dynamically get version number of the parent stylesheet (lets browsers re-cache your stylesheet when you update your theme)
	$theme   = wp_get_theme( 'Total' );
	$version = $theme->get( 'Version' );
	// Load the stylesheet
	wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css', array(), $version );
	
}
add_action( 'wp_enqueue_scripts', 'total_child_enqueue_parent_theme_style' );

Si observa el código, verá que lo que hace es cargar la hoja de estilo principal, pero al mismo tiempo incluye el número de versión del tema principal. Esto es muy importante pero no mucha gente lo hace. La razón para incluir el número de versión del tema principal es que siempre y cuando el tema principal se actualiza si ha habido algún cambio en la hoja de estilo del tema principal, los complementos de almacenamiento en cache, CDN y browsers saben que necesitan actualizar el archivo. Esto ayudará a prevenir cualquier CSS «roto» al actualizar su tema principal.

Move current manual editions to a subtopic

Now if you have already created your site and customized the main theme incorrectly and you don't have several free hours to sit and move your code from one file to another, you can always back up the current version of your site on a child. topic. Once you've created the child theme folder, just add copies of the files you've changed, then replace your WordPress theme with the one from the repository.

No es una solución perfecta, pero debería funcionar. El truco es asegurarse de no hacer una copia de seguridad de nada que no haya sido modificado, para que no termine sobrescribiendo accidentalmente el nuevo código que la actualización instalará con el código anterior. Por ende, aún necesita un conocimiento profundo de lo que personalizó, no puede simplemente copiar cosas al por mayor. Incluso podría ser útil revisar los archivos y quitar la mayor cantidad posible de código que no be suyo.

Back up your WordPress website

Primero, retroceda temprano y retroceda frecuentemente. WordPress almacena todo lo que ha escrito o cargado en su base de datos, y pueden sufrir fallas por muchas razones. Es muy fácil perder un sitio completo debido a una falla del server o una base de datos dañada. Por suerte, hacer una copia de seguridad solo lleva unos minutos.

There are many ways of doing it. First, you can simply copy the files to your computer using FTP clients or Unix Shell skills. At the same time you can use WinSCP to keep a "mirror" on your desktop that updates with your site.

Or is there a long list of automatic backup plugins, así como opciones premium. Aquí en R Digital marketing utilizamos VaultPress, y en el pasado hemos utilizado Backup Buddy, las cuales son excelentes opciones para crear y mantener copias de seguridad periódicas de su sitio web (a la vez de las copias de seguridad diarias proporcionadas por la mayoría de los planes de alojamiento de WordPress administrados).

By last, cPanel, Direct Admin, Ensim, Plesk, vDeck y Ferozo tienen formas únicas de realizar copias de seguridad de los sitios alojados con ellos. Se pueden encontrar instrucciones completas para eso en el WordPress Codex. In the worst case, when you lose something you really need, you can contact your host. Most hosts back up their sites, but it can be difficult to recover data from them.

Test your changes

In short, you can update manually or automatically. With manual update, you can test the changes to see if they screw up your site or not. WordPress treats two versions of the same theme as two different themes. In other words, if you have GenericTheme V1 and GenericTheme V1.1 on your wp-content / themes folder, they will be treated as two different topics. This means that you can have multiple versions of the same theme installed on your site. At a minimum, you can use this to switch between your old and custom version and the new one, so you have a reference in case you choose to rebuild from scratch with child themes.

conclusion

The prospect of losing the customizations you worked so hard on can be overwhelming, and the upgrade process can seem like it gets you there. But, with child themes (or plugins or frameworks) and a bit of foresight, it doesn't have to be this way. Do you have any other ideas to make regular updates to WordPress sites without losing customization? I'd love to hear about them in the comments!