サポート » テーマ » 各記事下 コメント欄のボタンのクリック範囲について

  • http://www.ampradio1037.com/

    各投稿ページの下に、「コメントする」という欄があり、
    左横の丸いボタンを押すと、コメント入力欄が表示されます。

    このボタンの「コメントする」の文字自体も、
    クリックして押せるようにしたのですが、
    どの部分を触れば良いのかが分かりません。

    どなたかご教授いただければ幸いです。
    何卒よろしくお願い致します。

    以下にcomments.phpを記載しておきます。

    <div id=”comments”>
    <?php if(have_comments()): ?>
    <h2 class=”comments-header”>コメント</h2>

      <?php wp_list_comments(‘callback=mydesign’); ?>

    <?php if ( get_comment_pages_count() > 1 && get_option( ‘page_comments’ ) ) :?>
    <div class=”com-nav” role=”navigation”>
    <div class=”com-back”><?php previous_comments_link( __( ‘« 古いコメント’, ” ) ); ?></div>
    <div class=”com-next”><?php next_comments_link( __( ‘新しいコメント »’, ” ) ); ?></div>
    </div><!– .com-nav –>
    <div class=”clear”></div>
    <?php endif; ?>

    <?php endif; ?>

    <?php
    // デフォルト値取得
    $commenter = wp_get_current_commenter();
    $req = get_option( ‘require_name_email’ );
    $aria_req = ( $req ? ” aria-required=’true'” : ” );

    //$fields設定
    $fields = array(
    ‘author’ => ‘<p class=”input-info”><label for=”author”>’ .
    ‘Name’ . ( $req ? ‘<span class=”required”>*</span>’ : ” ) . ‘</label> ‘ .
    ‘<br /><input id=”author” name=”author” type=”text” value=”‘ .
    esc_attr( $commenter[‘comment_author’] ) . ‘” size=”30″‘ . $aria_req . ‘ /></p>’,

    ‘email’ => ‘<p class=”input-info”><label for=”email”>’ .
    ‘Email’.( $req ? ‘<span class=”required”>*</span>(公開されません)’ : ” ) . ‘</label> ‘ .
    ‘<br /><input id=”email” name=”email” type=”text” value=”‘.
    esc_attr( $commenter[‘comment_author_email’] ) . ‘” size=”30″‘ . $aria_req . ‘ /></p>’,

    ‘url’ => ‘<p class=”input-info”><label for=”url”>’ .
    ‘Website’ . ‘</label>’ .
    ‘<br /><input id=”url” name=”url” type=”text” value=”‘ .
    esc_attr( $commenter[‘comment_author_url’] ) . ‘” size=”30″ /></p>’,
    );

    $fields = apply_filters( ‘comment_form_default_fields’, $fields );

    // $comment_notes_before設定
    $comment_notes_before = NULL;

    // $comment_notes_after
    $comment_notes_after = NULL;

    // $args設定
    $args = array(
    ‘fields’ => apply_filters( ‘comment_form_default_fields’, $fields ),
    ‘title_reply’ => ‘<p class=”go-comment-arrow lsf main-color-background”>down</p>コメントする’,
    ‘comment_notes_before’ => $comment_notes_before,
    ‘comment_notes_after’ => $comment_notes_after
    );
    ?>

    <?php comment_form($args); ?>

    </div><!– #comments –>

2件の返信を表示中 - 1 - 2件目 (全2件中)
  • ご利用のテーマがどのようなライセンスのものなのか不明ですが、WordPress 本体と同じく GPL だと思ってよろしいですね?(ソースコードの公開や改変が違反になるライセンスもありますので。)

    2ヵ所、変更します。
    1. クリック可能な範囲をspanタグで囲んで新しいクラスを付け
    2. クリックを検出するjsコード内のクラス指定をそれに入れ替えます。

    1. comments.php
    変更前:

    'title_reply' => '<p class="go-comment-arrow lsf main-color-background">down</p>コメントする',
    

    変更後:

    'title_reply' => '<span class="go-comment-arrow-text"><p class="go-comment-arrow lsf main-color-background">down</p>コメントする</span>',
    

    2. script.js
    変更前:

    	var bt_go_input = $(".go-comment-arrow");
    	var input = $(".comment-form");
    
    	bt_go_input.click(function(){
    

    変更後:

    	var bt_go_input = $(".go-comment-arrow");
    	var bt_go_holder = $(".go-comment-arrow-text");	// NEW!
    	var input = $(".comment-form");
    
    //	bt_go_input.click(function(){
    	bt_go_holder.click(function(){
    
    トピック投稿者 tomo_chocomint

    (@tomo_chocomint)

    ありがとうございます!
    無事解決いたしました!

2件の返信を表示中 - 1 - 2件目 (全2件中)
  • トピック「各記事下 コメント欄のボタンのクリック範囲について」には新たに返信することはできません。