Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

PHP - Condition for OG (Open Graph Protocol) in head element

0 votes
14 views
added Nov 6 in PHP by LC Marshal Captain (25,420 points)
<head>
    <meta http-equiv="x-dns-prefetch-control" content="on">
    <link rel="dns-prefetch" href="//www.xxxxx.my">
    <link rel="preconnect" href="//www.xxxxx.my">
    <link rel="dns-prefetch" href="//xxxxxx.cloudfront.net">
    <link rel="preconnect" href="//xxxxxxxx.cloudfront.net">
    <link rel="profile" href="<?php print $grddl_profile; ?>" />
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="msvalidate.01" content="xxxxxxxxxxx" />
    <meta property="fb:pages" content="xxxxxxxx" />
    <meta property="fb:app_id" content="xxxxxxxxxxxxxxxx" />
    <?php
      $path = current_path();
      if(in_array($path,['defender','defenderl663'])): ?>
    <meta property="og:title" content="Defender | xxxxx.my" />
    <meta property="og:type" content="website"/>
    <meta property="og:description" content="bla bla bla bla bla" />
    <meta property="og:image" content="https://xxxxxx.cloudfront.net/image/defender/defender-lg.jpg" />
    <meta property="og:url" content="https://www.xxxxx.my/defender" />
    <?php endif; ?>
    
     
  </head>

 

Please log in or register to response this reference.

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