-
AuthorPosts
-
February 22, 2018 at 9:47 pm #916355
Hi,
for my child theme I had to adapt just a few lines of code inside of the “shortcodes.js” and currently I store this modified file inside of my child theme folder: /enfold-child/js/shortcodes.js
Unfortunately, this will prevent automatic updates of the shortcodes.js with new versions of the Enfold theme. Is there a more elegant way to just include my real changes inside of my child theme instead of copying a whole file into it?February 22, 2018 at 9:51 pm #916357Hey trconnected,
I think you may have a misunderstanding. The Child theme will import the update of parent theme automatically.
Best regards,
Jordan ShannonFebruary 22, 2018 at 10:09 pm #916364Sorry, maybe I didn’t explained myself well enough.
As I have a complete (manually modified) version of the “shortcodes.js” file inside of my child theme folder this file will (to my understanding) completely overwrite the shortcodes.js file of the parent theme (and its possible updates). So indeed the parents shortcodes.js will still be updated, but it will never take effect as it is overruled by the old replica in the child.February 22, 2018 at 10:24 pm #916371Hi,
Okay I see. Seeing ass you took this approach and how the majority of shortcode.js updates are made, check for the version.txt included in each update to see if any major updates have occurred to the file. If so you may need to re-do the process. again.
Best regards,
Jordan ShannonFebruary 22, 2018 at 10:42 pm #916375oh… so there is no elegant solution? :-(
Actually I wanted adapt the “transitionSpeed” of the image slider. Unfortunately, it is not sufficient to only increase the “hard coded” value of “transitionSpeed” but I also had to adapt a few lines of the code to avoid that the first slide was appearing faster than all other ones:
else { displaySlide.css(properties).avia_animate({opacity:1}, self.options.transitionSpeed, 'linear', function() // transitionSpeed between 1st, 2nd,... n-th slide, for child theme "transitionSpeed/2" has been replaced by "transitionSpeed" otherwise the transitionSpeed is different to the one from n -> 1. { hideSlide.avia_animate({opacity:0}, self.options.transitionSpeed, 'linear', fadeCallback); // transitionSpeed between n-th and 1-st slide. For child theme the hard coded value "200" has been set to the more generic solution, the variable "self.options.transitionSpeed". });
Maybe you could fix that in an update and make the “transitionSpeed” customizable value?
Best regards!
February 22, 2018 at 11:11 pm #916387Hi,
Unfortunately, I don’t believe this can be done via functions.php. If you would like to see the transition speed as user controllable in a future update though, you can request it in the feature queue. https://kriesi.at/support/enfold-feature-requests/
Best regards,
Jordan ShannonFebruary 23, 2018 at 7:47 pm #916806Hi Jordan,
thank you, I added this suggestion to the feature-requests.
Could you maybe give me a hint where I could learn more about how to modify (at least small) parts of shortcodes.js via functions.php?Have a nice weekend!
February 23, 2018 at 10:12 pm #916885Hi,
The thing is shortcodes.js is an actual template file, so its not editable via functions.php unfortunately. However for smaller tasks editing functions.php saves time and resources. Please view just this small helpful article for some of the edits than be achieved in most themes via functions.php: http://www.wpbeginner.com/wp-tutorials/25-extremely-useful-tricks-for-the-wordpress-functions-file/
Best regards,
Jordan ShannonFebruary 23, 2018 at 10:54 pm #916902Super nice! Thank you! I guess this thread can be closed :-)
-
AuthorPosts
- The topic ‘modifications of shortcodes.js via child theme while still getting updates’ is closed to new replies.