0

だから私はを使用していDisqus Plugin v2.65ます。dsq-global-toolbarDisqus コメントの上部にあるを編集しようとしています。

以下のタグが入っています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">

dsq-content divただし、私のサイトには、と の間に動的に追加されるように見える複数のタグ (disqus-global-toolbar div) がありdsq-comments ulます。これはどこから来て、どこで編集できますか? どんな助けでも大歓迎です。

4

2 に答える 2

0

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ラッパーと同様に削除できます。

それはあなたが探しているものですか?


このようなもの(ライブの代わりにライブクエリを使用):

 function disqusReady() {
  $('#dsq-global-toolbar').livequery(function() {
    //$(this) will refer to object   
  });
 }
于 2011-06-30T01:52:03.407 に答える
0

どのプラグインについて話しているのかわかりませんが、WordPress の場合は同じことをしました。wp-content/plug-ins/disqus-comment-system/comments.php を変更して、'afterRender' のイベント ハンドラーを追加します (DOM でコンテンツの準備ができているが、まだ非表示になっている場合に発生します)。70行目あたり:

config.callbacks.afterRender.push(myFunctionToModifyDisqusOutput);
于 2011-07-07T20:09:38.720 に答える