THIS THREAD HAS BEEN CLOSED.

[Tutorial]How to move files from parent-theme to child-theme

Updated on May 5, 2014 in ForumEngine
1 on May 5, 2014

Hi guys,
This tutorial will help you to make some customizes without worry about losing your change when updating theme.
1.PHP files:

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

2.Javascript files:

– First, you have to add this code to functions.php in child-theme folder: for example i want to copy file front.js to child-theme


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"));

}


– Second, copy javascript files from parent-theme to child-theme folder (forumengine-child/js/front.js)

  • Liked by
  • mattk mattk
  • Autumn Martin
  • thaint
  • Nopnithi Khaokaew
  • +2
0 on May 5, 2014

Here is the full list name used as a handle for the script:

front.js => wp_enqueue_script('site-front', get_stylesheet_directory_uri(). '/js/front.js', array('jquery', 'underscore', 'backbone', 'site-functions'));
script.js => wp_enqueue_script('site-script', get_stylesheet_directory_uri(). '/js/script.js', 'jquery');
single-thread.js => wp_enqueue_script('fe-single-thread', get_stylesheet_directory_uri(). '/js/single-thread.js', array('jquery', 'backbone', 'underscore'));
 

  • Liked by
Cancel
Loading more replies
Posting & Replying function will be deactivated from 3pm GMT+7 12th Sep.
Read More