Tips to update your theme

Updated on November 15, 2024 in No Category
0 on December 18, 2014

This tutorial will help you keep some customization when updating the theme, no more worrying about losing the settings anymore.

1. PHP files:
Simply copy the files (e.g: header.php or footer.php ) from parent-theme (forumengine) to the child-theme.

2. Javascript files:

First, you have to add this code to the file “functions.php” in the child-theme folder. For example: If you want to copy the file “front.js” to child-theme, you can follow these below steps:

add_action("wp_enqueue_scripts","fe_child_scripts");
functions fe_child_scripts(){
wp_deregister_script("site-front");
wp_enqueue_script("site-front", get_stylesheet_directory_uri(). "/js/front.js", array("jquery", "underscore", "backbone", "site-functions"));
}

Then copy javascript files from the parent-theme to child-theme folder (forumengine-child/js/front.js).
Here is the full list name which can be used as a handle for the script:

In front.js:

wp_enqueue_script('site-front', get_stylesheet_directory_uri(). '/js/front.js', array('jquery', 'underscore', 'backbone', 'site-functions'));

In script.js

wp_enqueue_script('site-script', get_stylesheet_directory_uri(). '/js/script.js', 'jquery');

In single-thread.js

wp_enqueue_script('fe-single-thread', get_stylesheet_directory_uri(). '/js/single-thread.js', array('jquery', 'backbone', 'underscore'));
 
  • Liked by
Reply