动态标签的Disqus插件解释

|| 所以我在用
Disqus Plugin v2.65
。我正在尝试编辑Disqus评论顶部的ѭ1。 以下标签在
disqus-comment-system/comments.php
<div id=\"disqus_thread\">

 <?php if (!get_option(\'disqus_disable_ssr\')): ?>
  <?php
   // if (is_file(TEMPLATEPATH . \'/comments.php\')) {
   // include(TEMPLATEPATH . \'/comments.php\');
   // }
  ?>
  <div id=\"dsq-content\">
   <ul id=\"dsq-comments\">
但是,在我的网站上,似乎有多个标签(disqus-global-toolbar div)似乎动态地附加在
dsq-content div
dsq-comments ul
之间。这是哪里来的,我可以在哪里编辑?任何帮助将不胜感激。     
已邀请:
        我认为它正在disqus.js中的3140行附近 您可以使用以下代码来等待文档完全加载,然后进行更改(客户端):
$(document).ready(function() {
   window.disqus_no_style = true;

   $.getScript(\'http://sitename.disqus.com/embed.js\', function() {
     var loader = setInterval(function() {
       if($(\'#disqus_thread\').html().length) {
         clearInterval(loader);
         disqusReady();
       }
     }, 1000);
});

 function disqusReady() {
 //whatever you can imagine
 }
});
可以删除window.diqus_no_style以及$ .getsript包装器。 那是您要找的东西吗? 这样的事情(使用livequery而不是live):
 function disqusReady() {
  $(\'#dsq-global-toolbar\').livequery(function() {
    //$(this) will refer to object   
  });
 }
    
        不知道您在说什么插件,但是如果是WordPress,我也做了同样的事情。修改wp-content / plug-ins / disqus-comment-system / comments.php,方法是为\'afterRender \'添加一个事件处理程序(当内容在DOM中准备好但仍然隐藏时触发)。在第70行附近:
config.callbacks.afterRender.push(myFunctionToModifyDisqusOutput);
    

要回复问题请先登录注册