Modification of free or paid WordPress themes

You successfully installed a free or paid WordPress theme according to your wishes and started to enter content – but suddenly you notice that something is bothering you: some articles require an additional image to be added in the head section, you do not want links to be underlined but to change colour, your logo is in the bottom section but you would like to add some text underneath… Problem: the author of the free theme does not care about modifications and the author of the paid theme has no time. What to do? In this article, we will show you how to correctly approach modifications of WordPress themes.

Modification of free or paid WordPress themes

The biggest mistake you can make when implementing modifications is to directly change the theme. If you update the modified theme, you lose all modifications and you have to implement them again. If you are thinking about simply not updating the modified theme, please read our article on how to protect your WordPress installation from hacks and you will quickly change your mind. The solution to still be able to update the theme and also use the modification is to use child themes.

How to create a child theme?

In the themes folder wp-content/themes/ you first have to create a subfolder that will contain files of the child theme. For an easier maintenance, it is recommended to name the folder by adding -child to the original theme name (e.g. ideaz-child). In the created folder, you will have to create at least two files: style.css and functions.php.

Theme Name: Ideaz child
Template: ideaz
Author: Digital Agency Ideaz
Description: Modificated Webpage of Ideaz Digital Agency
Version: 1.0 pre-alpha

<?php
function popravki_nadrejene_teme() {
wp_enqueue_style( ‘ideaz’, get_template_directory_uri() . ‘/style.css’ );
wp_enqueue_style( ‘ideaz-child’, get_stylesheet_directory_uri() . ‘/style.css’, array( ‘ideaz’ ));
}
add_action( ‘wp_enqueue_scripts’, ‘popravki_nadrejene_teme’ );
?>

Theme activation, adding modification and creating additional templates

If you performed the above steps correctly, the appearance menu should now show the option for activating the child theme. You can click on the preview and if everything is OK, you can activate it. Remember that after activation, you may have to recreate some menus. And now, after covering the easier part, comes the harder part: adding modifications.

Appearance modifications can be entered as CSS code in the style.css file; but be careful not to delete the head mentioned above. Core modification of the parent theme should be entered into the functions.php file; but remember that the functions.php file of the child theme loads before the same file of the parent theme. In both cases, you have to bear in mind that you are retyping the existing code or adding capabilities, which is why you should not copy all the content from the parent theme.

All the other template files (page.php, single.php, front-page.php, itd.) will be copied from the parent theme, which is why it is recommended to copy the file from the parent theme as a basis. You can also create own, specific template files that are not included in the original theme. For this purpose, see the WordPress guide on template hierarchy.

Do you require assistance?

Because of many guides available, adding modifications may seem simple but do not be deceived. Incorrectly written code can collapse the structure of the site or significantly slow down the loading time. An incorrectly inserted semicolon or curly bracket can take hours until you identify the error. Code copied from another source can cause unexpected bugs or safety vulnerability that you may not see, but criminals definitely will. Would you not rather invest the time spent on modifications in selling your product and/or developing new ideas on improving the product?

As a team with several years of experience in the field of WordPress theme development, we can implement any modification fast and transparently, while thoroughly testing the final site (for more details see our workflow). Contact us and we will surely find a way of providing the assistance you require.

Why choose a WooCommerce online store?

Why choose a WooCommerce online store?

WooCommerce is a free and open source online store that was published in 2011 as a WordPress plugin. Its advantages are simple use, high performance and flexibility, and it can be used both for small stores with only tens of items and big stores with several thousand items. It can be used to change your […]

Povečanje spletne prodaje in lojalnosti kupcev

Increasing online sales and customer loyalty

Research shows that companies spend five times more on acquiring new customers than on retaining existing ones.

How to embed interactive content into WordPress?

How to embed interactive content into WordPress?

You wrote an extensive post, added some pictures, and now you would like to add some interactivity. You would like to include a Youtube video to break up the text blocks, or a interesting Tweet to back up your claims. You maybe also want to promote a Kickstarter project or maybe your own post on […]