• Hi,

    I created a child theme and I want to edit the code included into the php files. In my understanding, I have to copy the files from the parent to the child theme.I foresee that I will have to copy almost all php files to child theme.

    1-Are there other options (different to copy the files) to edit the php files? ? Any plugin?

    2-If I copied the files, how does it affect to the website speed load?

    3-And for the js files; what options are there?

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • 1 – No. Just copy them as you make the modifications to each file. Copying files like that really doesn’t take that long, and you will be able to keep track of which ones you’ve modified and which ones yu haven’t.

    2 – It doesn’t. If anything it might give it a (very) small speed increase because WordPress is will find the file in the child theme instead of not finding it in the child theme and then finding it in the parent theme.

    3 – If you need to change things with JavaScript the bestthing to do is use wp_dequeue_script() to remove the existing JS file link, and then enqueue your own files.

    Thread Starter fernanf

    (@fernanf)

    But do I have to copy the php files in child theme and keep the originals in parent theme or delete them from parent theme?
    Thanks

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    No you don’t. A lot of the PHP files will cause your website to break if you copy them over.

    The parent theme should not be touched when creating a Child Theme.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Child theme: edit php and js files’ is closed to new replies.