PHP - Multiple nodes condition

0 votes
81 views
added Nov 6, 2019 in PHP by LC Marshal Captain (25,770 points)
<?php
  $path = current_path();
  if(in_array($path,['node/21','node/22','node/23'])): ?>
    <script async src="https://www.googletagmanager.com/gtag/js?id=XX-XXXXXXXX"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'XX-XXXXXXXXX');
    </script>
<?php endif; ?>

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...