Are you first timer at 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
added Nov 6, 2019 in PHP by LC Marshal Captain (25,840 points)
    <meta http-equiv="x-dns-prefetch-control" content="on">
    <link rel="dns-prefetch" href="//">
    <link rel="preconnect" href="//">
    <link rel="dns-prefetch" href="//">
    <link rel="preconnect" href="//">
    <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" />
      $path = current_path();
      if(in_array($path,['defender','defenderl663'])): ?>
    <meta property="og:title" content="Defender |" />
    <meta property="og:type" content="website"/>
    <meta property="og:description" content="bla bla bla bla bla" />
    <meta property="og:image" content="" />
    <meta property="og:url" content="" />
    <?php endif; ?>


Please log in or register to response this reference. - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.