Closed Silverunit closed 9 years ago
Hello,
How about this:
<meta name="twitter:card" content="summery" />
<meta name="twitter:site" content="@silverunit" />
<meta name="twitter:title" content="<?php echo $title ?>" />
<meta name="twitter:description" content="<?php echo $description ?>" />
<meta name="twitter:url" content="<?php echo $canonical ?>" />
Hi,
Thanks for your answer. I could not get this either to work. Your answer did get me to work on this matter again. Have not been thinking about it for some time now.
I had missed one BIG thing, my bad, I needed to include it on the functions file and it looks like this:
// <!-- META DATA open graph | title 90 char | description 200 char -->
$ogtype = '<meta property="og:type" content="website" />';
$ogtitle = '<meta property="og:title" content="' . $title . ' | Silverunit Systems" />';
$ogdesc = '<meta property="og:description" content="' . $description . '" />';
$ogurl = '<meta property="og:url" content="' . $canonical . '" />';
//<meta property="og:image" content="http://www.silverunitsystems.se/images/share/silverunit-systems-feeds-nyheter.jpeg" />
// <!-- META DATA twitter card | title 70 char | description 200 char -->
$tcard = '<meta name="twitter:card" content="summery" />';
$tsite = '<meta name="twitter:site" content="@silverunit" />';
$ttitle = '<meta name="twitter:title" content="' . $title . ' | Silverunit Systems" />';
$tdesc = '<meta name="twitter:description" content="' . $description . '" />';
$turl = '<meta name="twitter:url" content="' . $canonical . '" />';
But I ran in to another issue, the $title, $description and $canonical liked to output the total meta information. I then did change the first $title, $description and $canonical with adding a "h" in the name. Like this $htitle = '
And then I did the same in if's for the out put. Now it works nice and as it should, i think.
Will creed you and this wonderful blogfunktion when we go live! Thanks again, Michael - sweden
Ah forgot if I move those variables into head_contents :) perhaps I will move it out for those purpose.
Yes I noticed that :) And If you do implement this feature do not forget to add "prefix="og: http://ogp.me/ns#" to the html tag. I think this would be nice to have for the share options you already have.
Hi,
Does anyone have an idea about this. I use a plan html template and would like to add og and twitter tags. Use the code below:
In the layout file. It works on each post. That I could understand as $p marks posts. But when viewing the main page. The marks are showing the second post in the feed. Not the first or not the main config information.
Any thoughts? Best regards, Michael