Tagged: x
-
AuthorPosts
-
April 19, 2016 at 5:45 pm #890881
AnonymousInactiveHi,
I am wondering where I am supposed to save the new or edited css (or javascript) when a child theme is activated, so that there are no changes when updating wordpress or the parent theme. Should I save CSS in the style.css file that comes with x-child, or it is fine to save CSS in the Custom Section in WordPress. I noticed that when I save CSS in the the Custom Section, the changes are applied to the theme but they are not saved in the style.css in x-child. Is that normal? If the new CSS is not saved there, does it prevent the theme customization from changing when updating?
Thanks!
April 20, 2016 at 6:12 am #891580
LelyModeratorHi There,
We can save custom CSS in Appearance > Customize > Custom > CSS > Custom Code > Edit Global CSS. This will be save in the database and not on child theme style.css file. Yes, that is normal Other option is to save it on style.css file of child theme. Both of those CSS will stay intact when you update the theme. Javascript should be added on child theme’s functions.php like below:
function custom_js_code() { ?> <script> // JAVASCRIPT CODE HERE </script> <?php } add_action( 'wp_footer', 'custom_js_code' );Hope this helps.
April 20, 2016 at 11:49 am #892144
AnonymousInactiveYes, this helps. Thanks a lot.
April 20, 2016 at 10:42 pm #892923
Prasant RaiModeratorYou are most welcome. 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-890881 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
