定制"分享"链接:无效标记

时间:2014-07-31 08:09:17

标签: html validation share

我创建了自定义共享按钮,以便在我的wordpress网站上使用它们。我按照我在网上找到的一些教程,但我不记得它的链接。

这是我的代码(我将有点URL更改为1234,通常是那些有用的真实链接)

<div class="share">
<h4>Share this:</h4>
<a target="_blank" href="http://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>">
    <img alt="Like" title="Share on Facebook" src="<?php bloginfo( 'template_url' ); ?>/files/images/like.png">
</a>

<a target="_blank" href="http://twitter.com/share?url=<?php echo urlencode( bitly()); ?>&amp;text=<?php the_title(); ?>">
    <img alt="Tweet" title="Tweet" src="<?php bloginfo( 'template_url' ); ?>/files/images/tweet.png">
</a>

<a target="_blank" href="https://plus.google.com/share?url=<?php echo urlencode( bitly()); ?>">
    <img alt="Recommend" title="Share on Google+" src="<?php bloginfo( 'template_url' ); ?>/files/images/recommend.png">
</a>

<a href="mailto:Choose contact?subject=Link geteilt:&nbsp;<?php bloginfo('name'); ?>&amp;Body=Hello, I found something interesting today, have a look:&nbsp;<?php the_title(); ?>&nbsp;-&nbsp;<?php the_permalink(); ?>">
    <img alt="Send as E-Mail" title="E-Mail" src="<?php bloginfo( 'template_url' ); ?>/files/images/mail.png">
</a>

W3C标记验证器在此处显示两个错误:

  

价值不佳的http://twitter.com/share?url=http://bit.ly/1234&text=Hello世界!对于元素a上的属性href:查询中的非法字符:不是URL代码点。

on …ref="http://twitter.com/share?url=http://bit.ly/1234&amp;text=Hello world!"

  

元素a上属性href的值不正确:方案数据中的非法字符:不是URL代码点。

on &nbsp;Hello world!&nbsp;-&nbsp;http://my-url.com/article">

有人能告诉我这里有什么问题吗?如您所见,我的脸书或googleplus分享按钮没有显示任何错误。此外,尽管存在这些错误,但共享确实有效。

0 个答案:

没有答案
相关问题