Guest User

Untitled

a guest
May 23rd, 2019
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.98 KB | None | 0 0
  1. <?php
  2.  
  3. // =============================================================================
  4. // FUNCTIONS.PHP
  5. // -----------------------------------------------------------------------------
  6. // Overwrite or add your own custom functions to X in this file.
  7. // =============================================================================
  8.  
  9. // =============================================================================
  10. // TABLE OF CONTENTS
  11. // -----------------------------------------------------------------------------
  12. //   01. Enqueue Parent Stylesheet
  13. //   02. Additional Functions
  14. // =============================================================================
  15.  
  16. // Enqueue Parent Stylesheet
  17. // =============================================================================
  18.  
  19. add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );
  20.  
  21.  
  22.  
  23. // Additional Functions
  24. // =============================================================================
  25.  
  26. add_action('wp_head', 'wpb_add_googleanalytics');
  27. function wpb_add_googleanalytics() { ?>
  28.  
  29. <!-- Global site tag (gtag.js) - Google Analytics -->
  30. <script async src="https://www.googletagmanager.com/gtag/js?id=UA-140725938-1"></script>
  31. <script>
  32.   window.dataLayer = window.dataLayer || [];
  33.   function gtag(){dataLayer.push(arguments);}
  34.   gtag('js', new Date());
  35.  
  36.   gtag('config', 'UA-140725938-1');
  37.  
  38. </script>
  39.  
  40. <?php }
  41.  
  42. add_action( 'wp_head', 'x_insert_header_scripts' );
  43. function x_insert_header_scripts(){
  44.     ?>
  45.  
  46. <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css" />
  47. <script src="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js"></script>
  48. <script>
  49. window.addEventListener("load", function(){
  50. window.cookieconsent.initialise({
  51.   "palette": {
  52.     "popup": {
  53.       "background": "#efefef",
  54.       "text": "#404040"
  55.     },
  56.     "button": {
  57.       "background": "#8ec760",
  58.       "text": "#ffffff"
  59.     }
  60.   }
  61. })});
  62. </script>
  63.  
  64. <?php
  65. }
Advertisement
Add Comment
Please, Sign In to add comment