-
AuthorPosts
-
February 25, 2016 at 8:35 am #812022
I would like to integrate the following Java Script into my Custom CSS. How could I get it work?
<script type=”text/javascript”>
window.cookieconsent_options = {“message”:”Diese Website verwendet Cookies, um Ihnen das bestmögliche Nutzungserlebnis bieten zu können.”,”dismiss”:”Verstanden”,”learnMore”:”Mehr Informationen”,”link”:”http://le-vinothek.de/datenschutz”,”theme”:”light-top”};<script type=”text/javascript” src=”//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/1.0.9/cookieconsent.min.js”>
February 25, 2016 at 12:02 pm #812279Hi there,
We recommend you to setup a Child Theme first to add your own customizations to the theme. In that way, you won’t be losing your custom code when updating the X Theme.
Please check our guide on How to setup a Child Theme at this URL (http://theme.co/x/member/kb/how-to-setup-child-themes/).
Once you activated the child theme, follow the code below and it to the Child Theme’s “functions.php” file.
add_action( 'wp_head', 'my_custom_scripts' ); function my_custom_scripts(){ ?> <script type="text/javascript"> window.cookieconsent_options = {“message”:”Diese Website verwendet Cookies, um Ihnen das bestmögliche Nutzungserlebnis bieten zu können.”,”dismiss”:”Verstanden”,”learnMore”:”Mehr Informationen”,”link”:”http://le-vinothek.de/datenschutz”,”theme”:”light-top”}; </script> <script type=”text/javascript” src=”//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/1.0.9/cookieconsent.min.js”> <?php }
To avoid any mistakes and would be easier for you to manage the code for the header or for the footer, please use a 3rd party plugin instead. You can install this plugin: https://wordpress.org/plugins/header-and-footer-scripts/
Hope this helps. Please let us know how it goes.
February 25, 2016 at 1:58 pm #812422Thanks for the reply. I already made a website, not using the child theme. Is there a way to copy all my “files” into the child theme?
February 25, 2016 at 9:27 pm #812901Hello There,
Do you know which file you have edited in your parent theme? If you can remember, you can simply copy those files and place in your child theme with the same folder where it is located in the parent theme. If you have added any custom functions in the parent theme’s functions.php file, you can remove that and place it into your child theme’s functions.php file instead. You do not have to worry about the customizer settings because you can save or export and import the XCS file by going to X Addons > Customizer manager. You must do export the XCS file first as your backup before activating the child theme.
Hope this helps.
February 26, 2016 at 4:28 am #813328I haven’t touched any file. I just used Cornerstone to set up my pages and installed a couple plugins. I only used the Cutom CSS field.
February 26, 2016 at 4:33 am #813330I just installed the child theme. Now I understand how it works :D. The website is still working, thanks for the support.
February 26, 2016 at 6:47 am #813428Glad to hear it’s working for you now! 🙂 Have a good day.
-
AuthorPosts