WordPress Theme and Plugin Customization
<?php show_admin_bar(false); function bt_scripts() { wp_enqueue_script('bt-jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js'); wp_enqueue_script('scripts', get_template_directory_uri() . '/js/scripts.js'); wp_enqueue_script('edgefonts', '//use.edgefonts.net/passion-one;source-sans-pro:n3,i3,n4,i4,n7,i7,n9,i9.js'); wp_enqueue_script('bootstrap-js', 'http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js'); wp_localize_script('scripts', 'MyAjax', array('ajaxurl' => admin_url('admin-ajax.php'))); wp_enqueue_style('bootstrap-css', 'http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css'); wp_enqueue_style('style', get_template_directory_uri() . '/style.css'); wp_enqueue_style('media-rules', get_template_directory_uri() . '/css/media.css'); wp_enqueue_style('bs-overides', get_template_directory_uri() . '/css/bs-overides.css'); } add_action('wp_enqueue_scripts', 'bt_scripts');
When customizing an existing theme, you can create a child theme so that general updates to the theme do not overwrite your modifications.
Sometimes it may be simpler and preferable to create a plugin rather than modify the existing theme code. The advantage of writing a plugin is that the client can change the theme and the plugin will still work. There is also the possibility that there may already be an existing child theme in use for the parent theme.
When modifying plugins it may be necessary to actually overwrite the plugin source code if customization methods such as those provided by a plugin like woocommerce are not available. The obvious disadvantage when making these types of changes is that you can no longer update the plugin without overwriting your modifications. At that point it’s a good idea wait until it’s absolutely necessary to update the plugin. For example, when a plugin is no longer compatible with the current version of WordPress.
This brings up another issue regarding WordPress core updates. You need to be careful when updating WordPress itself as bugs can often crop up relating to customized or third party themes and plugins. It is best if you have a version of your website running on a local or staging server where you can test out updates before performing them on a live server. It can be costly if you constantly have to address bugs in themes and plugins due to updates. You may want to limit the amount of updates to once a year or even longer if your website is running fast and stable.