Jump to content

Include header: issue with metadata


Michkael
 Share

Recommended Posts

Good morning everyone,

Reading the forum I have realised that a good practice is to include header and footer from external files.
This works just fine, the problem now is that the metadata are in the header, precisely in the head.
When I open the homepage template I have 2 fields for the metadata: the MetaPreview and the MetaDescription.

The code below represents the code in the header.php:
 

  <title><?=$page->title;?></title>

  <!-- Site Meta Info -->
  <meta charset="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <meta name="description" content="<?=$page->MetaDescription;?>">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!--<link rel="apple-touch-icon" href="apple-touch-icon.png">-->
  <meta property="og:type" content="website" />
  <meta property="og:title" content="Blockchain Related Services"/>
  <meta property="og:image" content="<?=$page->MetaPreview->url;?>" />
  <meta property="og:url" content="<?=$page->url;?>" />
  <meta property="og:description" content="<?=$page->MetaDescription;?>" >
  <meta property="fb:app_id" content="330744850807211">

 

The $page->title works fine but the fields used for the metadata are not working, when I paste the url of the homepage, no preview and description pop-up.
The exact same format using static HTML worked just fine.

Do you have any suggestion?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...