开发者

how to add an Open Graph og:description a href link along with php echo statement

I´m creating OpenGraph protocol head descriptions and wanted to fancy up the outputted code to eventually display the (("the description" along with View Collection...)) as an additional trailing linkable word.

The working simple code is this:

 <meta property="og:description" content="<?php echo $this->getDescription() ?>"/>

I´ve unsuccessfully used this:

<meta property="og:description" content="<?php echo $this->getDescription() 开发者_如何学Python?> <a href="http://www.example.com">view collection...</a>"/>

Since this meta property tag is within the head, it creates a problem with an a href statement. Is there a proper way for this to be done? Additionally, I think the syntax is wrong.

Any help?


You can't put hyperlinks inside a meta tag, I'm afraid. Neither the HTML standard nor Facebook's OpenGraph standard supports the effect you're trying to achieve.


Use the <meta property="og:url" content="http://yourlink.com"> to send a link for your Collection. It want display inside your description, but if you properly present you USP and direct viewers to use it you will get the same result. @user816749

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜