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.

WooCommerce vs Shopify: which e-commerce store should you choose?

WooCommerce vs Shopify: which e-commerce store should you choose?

WooCommerce and Shopify are among the world’s most popular eCommerce platforms. Some sources estimate that the former has almost a third of the eCommerce market share (which is a massive lead over the competition), but the latter is slowly catching up. WooCommerce is an open source plugin for WordPress developed by WooThemes and acquired by […]

Web browser HTTP security warnings explained

Web browser HTTP security warnings explained

Since your blog or website appeared on the web, you have been regularly maintaining it, performing regular security checks and updating the core/plugins. In 2018, a security lock with a red slash and with a Not secure warning suddenly appeared in your favorite browser. Was your site hacked and you missed it? Don’t worry, we will try to explain […]

Zaščitite vašo namestitev Wordpressa pred vdori

Protect your WordPress installation from hacks

Statistični podatki za leto 2016 kažejo, da naj bi WordPress poganjal že več kot četrtino spletišč, med sistemi za upravljanje vsebin (CMS) pa prevladuje s skoraj dvotretjinskim deležem. Enostavna uporaba, odprtokodnost in več deset tisoč vstavkov poskrbita, da se tržni delež WordPressa vztrajno povečuje. Zaradi velike razširjenosti je WordPress pogosta tarča zlikovcev, ki izkoriščajo varnostne […]