就像按钮和盒子一样消失了 [英] Like buttons and like box vanished

查看:25
本文介绍了就像按钮和盒子一样消失了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

讨厌问一些很可能是我的错,但我很难过.首先,我绝对不是真正的开发人员或网站设计师.我自愿为一个我自愿参加的非营利组织建立一个新网站,因为我知道的比其他任何人都多(可怕的警告标志).使用 wordpress(Facebook 按钮没有插件).

本计划在本周上线,但我离开去吃午饭,回来后发现 Facebook 上所有的 Like 按钮和 Like 框都消失了(它们已经正常运行了大约两周).当我使用 Chrome Web Developer 检查代码时,我看到代码仍然存在,但呈灰色.

主页上有一个很好的例子:www.thecarecommunities.com 在页面底部,赞助商徽标和推特提要之间应该有一个赞框.另一个位置在诸如这里的帖子上:http://thecarecommunities.com/gala-press-release/ 推特按钮前应该有一个 Facebook Like 按钮,推特提要上方右侧应该有一个 Like Box.

我是唯一可以访问这些文件的人,我已经仔细检查了标题中的脚本代码、将按钮放置在应有位置的代码,一切都保持原样.如果有人可以协助查找错误,我将不胜感激.

附注.当前网站是 www.thecarecommunities.org,所以大部分链接已经设置为切换到 .org 域,所以现在很多链接都转到 404 页面.

  1. 标题中的 SDK 脚本

    add_action('headway_body_open', 'fb_sdk_script');函数 fb_sdk_script () {?><div><div id="fb-root"></div><脚本>(函数(d,s,id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) 返回;js = d.createElement(s);js.id = id;js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script>

<?

  • 喜欢首页 www.thecarecommunities.com 上的 Box

    <div class="fb-like-box" data-href="http://www.facebook.com/thecarecommunities"data-width="406" data-height="520" 数据-show-faces="true" data-stream="false"data-header="true"></div>

  • 点赞按钮应该位于主页顶部的推特按钮

    <div class="fb-like" data-href="http://thecarecommunities.org" data-send="false" data-layout="button_count" data-width="60"data-show-faces="false"></div>

  • 解决方案

    有一个 google 调用加上你脑子里的一个脚本,看起来像这样:

    这会阻止加载 Facebook SDK 的后续脚本标签.

    Hate to ask about something that is most likely my fault, but am stumped. First, I am definitely NOT anything close to an actual developer or website designer. I volunteered to put together a new website for a non-profit I volunteer with since I knew more than anyone else (scary warning sign). Using wordpress (no plugins for the facebook buttons).

    Was planning on going live this week, but I left to grab lunch, came back and literally all of the Facebook Like buttons and Like boxes had just vanished (they had been up and running fine for about two weeks). When I check the code with Chrome Web Developer, I see the code is all still there, but grayed out.

    A good example is on the main page: www.thecarecommunities.com At the bottom of the page, there should be a Like Box between the sponsor logos and twitter feed. Another spot is on the posts such as here: http://thecarecommunities.com/gala-press-release/ There should be a Facebook Like button before the twitter button and a Like Box on the right side above the twitter feed.

    I am the only one with access to the files, I have double checked the script code in the header, the code to put the buttons where they should be, and everything is still as it has been. If anyone could assist in finding the error, I would really appreciate it.

    PS. current website is www.thecarecommunities.org, so most of the links are already set for the switch to the .org domain, so many go to 404 pages right now.

    1. SDK script in the header

      add_action('headway_body_open', 'fb_sdk_script');
      function fb_sdk_script () {
      ?> 
      <div>
      <div id="fb-root"></div>
      <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
      fjs.parentNode.insertBefore(js, fjs);
      }(document, 'script', 'facebook-jssdk'));</script>  
      </div>
      <?
      

    2. Like Box on front page www.thecarecommunities.com

      <div class="fb-like-box" data-href="http://www.facebook.com/thecarecommunities"data-width="406" data-height="520" data-show-faces="true" data-stream="false"data-header="true"></div>   
      

    3. Like button that should be at the top of the home page by the twitter button

      <div class="fb-like" data-href="http://thecarecommunities.org" data-send="false" data-layout="button_count" data-width="60" data-show-faces="false"></div>
      

    解决方案

    There is a call to the google plus one script in your head that looks like this:

    <script gapi_processed="true" type="text/javascript" src="https://apis.google.com/js/plusone.js">
      {"parsetags": "explicit"}
    

    This script tag is not closed with a closure. It needs to be:

    <script gapi_processed="true" type="text/javascript" src="https://apis.google.com/js/plusone.js">
      {"parsetags": "explicit"}
     </script>
    

    This is blocking the subsequent script tag, which loads the Facebook SDK, from loading.

    这篇关于就像按钮和盒子一样消失了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆