Modifying .js file using child Theme

Posted in: Newspaper
Post count: 6

Hey Guys,

We are using a child theme and need to modfify the file site.js

We copy the file to the corresponding child folder, but changes don’t take effect because WordPress is looking for the file on the parent folder.

We saw that parent’s function.php sets where to look for the .js files and that is on the parent’s directory instead of the child’s.

Is there a way we can accomplish this by not modifying the parent function.php file?

In case there is no other way than modifying the parent’s file let us know and please include that change on the next release.

Thanks,

Post count: 9544

The “normal” way to do this is to add the call to your child theme folder functions.php to pull the js from your child theme directory vs the parent directory.

http://wordpress.org/support/topic/how-to-add-js-files-to-child-theme

Post count: 6

Thanks @Christopher, but it doesn’t work for us, because the call is already defined on the parent functions.php and if we add it to the child functions.php the site breaks.

What we read around different forums is that the parent function has to be programmed conditionally and not load if it exists on the child theme that’s the code we’ll need to change and also be added to the new version.

Best,

Post count: 9544

Gotcha – makes sense to me 🙂

Probably explains why the custom functions didn’t work for me one our two test sites.

I switched one from using child theme to only use parent (since Google doesn’t like the CSS redirect, for their own peculiar reasons) and simply edited the parent functions.php to put my custom functions at end (like changing compression rate for images, removing excess css publication, etc.).

Hopefully this will be addressed soon for those using child theme for mods.

Post count: 6

Thanks for you feedback Christopher.

We had to modify the parent functions.php too


@Radu
and co. please address this issue as soon as you can, we have the theme since version 1.0 and everytime we have to update it is a headache.

Best,

Post count: 780

@gaston I’ve added this to the todo list. V3.2 will also make child theme modification easier, we dump the variable concatenation in modules and we switched to plain html.

Radu O.

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.